Skip to content

Commit e0a5ef8

Browse files
committed
Merge pull request #7010
10953a7 Better error message for fundrawtransaction w/ empty vout (Peter Todd) 61e1eb2 Actually use includeWatching value in fundrawtransaction (Peter Todd)
2 parents dbd2c13 + 10953a7 commit e0a5ef8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,9 +2418,12 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
24182418
if (!DecodeHexTx(origTx, params[0].get_str()))
24192419
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
24202420

2421+
if (origTx.vout.size() == 0)
2422+
throw JSONRPCError(RPC_INVALID_PARAMETER, "TX must have at least one output");
2423+
24212424
bool includeWatching = false;
24222425
if (params.size() > 1)
2423-
includeWatching = true;
2426+
includeWatching = params[1].get_bool();
24242427

24252428
CMutableTransaction tx(origTx);
24262429
CAmount nFee;

0 commit comments

Comments
 (0)