diff options
| author | Peter Todd <[email protected]> | 2015-11-13 15:52:07 -0500 |
|---|---|---|
| committer | Peter Todd <[email protected]> | 2015-11-13 15:53:46 -0500 |
| commit | 10953a7d3241f66ab3b2921e0825d6857f64f6f7 (patch) | |
| tree | 33aaafb75be171848b1147396d8b26ab36d3e37e /src/wallet/rpcwallet.cpp | |
| parent | Actually use includeWatching value in fundrawtransaction (diff) | |
| download | discoin-10953a7d3241f66ab3b2921e0825d6857f64f6f7.tar.xz discoin-10953a7d3241f66ab3b2921e0825d6857f64f6f7.zip | |
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"
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 0bd130327..7b7c9b325 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2418,6 +2418,9 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp) if (!DecodeHexTx(origTx, params[0].get_str())) 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; if (params.size() > 1) includeWatching = params[1].get_bool(); |