aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Maxwell <[email protected]>2015-11-13 21:16:39 -0800
committerGregory Maxwell <[email protected]>2015-11-13 21:17:20 -0800
commite0a5ef84272b627a531f6bb46eb34c0ff16cef36 (patch)
tree33aaafb75be171848b1147396d8b26ab36d3e37e
parentMerge pull request #6990 (diff)
parentBetter error message for fundrawtransaction w/ empty vout (diff)
downloaddiscoin-e0a5ef84272b627a531f6bb46eb34c0ff16cef36.tar.xz
discoin-e0a5ef84272b627a531f6bb46eb34c0ff16cef36.zip
Merge pull request #7010
10953a7 Better error message for fundrawtransaction w/ empty vout (Peter Todd) 61e1eb2 Actually use includeWatching value in fundrawtransaction (Peter Todd)
-rw-r--r--src/wallet/rpcwallet.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index d93050d98..7b7c9b325 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2418,9 +2418,12 @@ 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 = true;
+ includeWatching = params[1].get_bool();
CMutableTransaction tx(origTx);
CAmount nFee;