mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Better error message for fundrawtransaction w/ empty vout
Previously this case failed deep in Cwallet::CreateTransaction() with the error message "Transaction amounts must be positive"
This commit is contained in:
parent
61e1eb2e1c
commit
10953a7d32
@ -2418,6 +2418,9 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
|
|||||||
if (!DecodeHexTx(origTx, params[0].get_str()))
|
if (!DecodeHexTx(origTx, params[0].get_str()))
|
||||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||||
|
|
||||||
|
if (origTx.vout.size() == 0)
|
||||||
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "TX must have at least one output");
|
||||||
|
|
||||||
bool includeWatching = false;
|
bool includeWatching = false;
|
||||||
if (params.size() > 1)
|
if (params.size() > 1)
|
||||||
includeWatching = params[1].get_bool();
|
includeWatching = params[1].get_bool();
|
||||||
|
Loading…
Reference in New Issue
Block a user