Skip to content

Commit

Permalink
Better error message for fundrawtransaction w/ empty vout
Browse files Browse the repository at this point in the history
Previously this case failed deep in Cwallet::CreateTransaction() with
the error message "Transaction amounts must be positive"

Github-Pull: bitcoin#7010
Rebased-From: 10953a7
  • Loading branch information
petertodd authored and luke-jr committed Nov 18, 2015
1 parent 46462bf commit 2b4108c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/rpcwallet.cpp
Expand Up @@ -2384,6 +2384,9 @@ Value fundrawtransaction(const Array& 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");

CMutableTransaction tx(origTx);
CAmount nFee;
string strFailReason;
Expand Down

0 comments on commit 2b4108c

Please sign in to comment.