aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-10-19 15:13:11 -0400
committerfanquake <fanquake@gmail.com>2022-10-28 17:58:28 +0800
commitbbe864a13a2e5ce15674eda5c3760ee851120c63 (patch)
tree44054dd64cce67828d15c465f7afb649cf7d19b8
parent4b7d30d026815dbe2330cd3e2edc044835a3eaed (diff)
downloadbitcoin-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
-rw-r--r--src/wallet/rpc/spend.cpp2
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;