diff options
author | Andrew Chow <github@achow101.com> | 2022-10-19 15:13:11 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2022-10-19 15:13:11 -0400 |
commit | 6bcd7e2a3b52f855db84cd23b5ee70d27be3434f (patch) | |
tree | 06068d2ee727d46c66d879a1c77c51f07a760b18 | |
parent | a97791d9fb977cf2a0d19268253238b0fee173f6 (diff) |
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.
-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 ebf694157b..e84fb6c661 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -1379,7 +1379,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; |