diff options
author | Andrew Chow <github@achow101.com> | 2022-10-19 15:13:11 -0400 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-10-28 17:58:28 +0800 |
commit | bbe864a13a2e5ce15674eda5c3760ee851120c63 (patch) | |
tree | 44054dd64cce67828d15c465f7afb649cf7d19b8 /src/wallet/rpc | |
parent | 4b7d30d026815dbe2330cd3e2edc044835a3eaed (diff) | |
download | bitcoin-bbe864a13a2e5ce15674eda5c3760ee851120c63.tar.xz |
wallet: Correctly check ismine for sendall
sendall should be using a bitwise AND for sendall's IsMine check rather
than an equality as IsMine will never return ISMINE_ALL.
Github-Pull: #26344
Rebased-From: 6bcd7e2a3b52f855db84cd23b5ee70d27be3434f
Diffstat (limited to 'src/wallet/rpc')
-rw-r--r-- | src/wallet/rpc/spend.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index e38b13624c..7d105b35b8 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -1380,7 +1380,7 @@ RPCHelpMan sendall() throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Input not available. UTXO (%s:%d) was already spent.", input.prevout.hash.ToString(), input.prevout.n)); } const CWalletTx* tx{pwallet->GetWalletTx(input.prevout.hash)}; - if (!tx || pwallet->IsMine(tx->tx->vout[input.prevout.n]) != (coin_control.fAllowWatchOnly ? ISMINE_ALL : ISMINE_SPENDABLE)) { + if (!tx || !(pwallet->IsMine(tx->tx->vout[input.prevout.n]) & (coin_control.fAllowWatchOnly ? ISMINE_ALL : ISMINE_SPENDABLE))) { throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Input not found. UTXO (%s:%d) is not part of wallet.", input.prevout.hash.ToString(), input.prevout.n)); } total_input_value += tx->tx->vout[input.prevout.n].nValue; |