diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3639,7 +3639,7 @@ const CScript &scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey; bool fValidAddress = ExtractDestination(scriptPubKey, address); bool reused = - avoid_reuse && pwallet->IsUsedDestination(out.tx->GetId(), out.i); + avoid_reuse && pwallet->IsSpentKey(out.tx->GetId(), out.i); if (destinations.size() && (!fValidAddress || !destinations.count(address))) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -951,11 +951,10 @@ EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); // Whether this or any UTXO with the same CTxDestination has been spent. - bool IsUsedDestination(const TxId &txid, unsigned int n) const + bool IsSpentKey(const TxId &txid, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); - void SetUsedDestinationState(WalletBatch &batch, const TxId &txid, - unsigned int n, bool used, - std::set &tx_destinations) + void SetSpentKeyState(WalletBatch &batch, const TxId &txid, unsigned int n, + bool used, std::set &tx_destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); std::vector GroupOutputs(const std::vector &outputs, diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -797,9 +797,9 @@ } } -void CWallet::SetUsedDestinationState( - WalletBatch &batch, const TxId &txid, unsigned int n, bool used, - std::set &tx_destinations) { +void CWallet::SetSpentKeyState(WalletBatch &batch, const TxId &txid, + unsigned int n, bool used, + std::set &tx_destinations) { AssertLockHeld(cs_wallet); const CWalletTx *srctx = GetWalletTx(txid); if (!srctx) { @@ -821,7 +821,7 @@ } } -bool CWallet::IsUsedDestination(const TxId &txid, unsigned int n) const { +bool CWallet::IsSpentKey(const TxId &txid, unsigned int n) const { AssertLockHeld(cs_wallet); CTxDestination dst; const CWalletTx *srctx = GetWalletTx(txid); @@ -862,8 +862,8 @@ for (const CTxIn &txin : wtxIn.tx->vin) { const COutPoint &op = txin.prevout; - SetUsedDestinationState(batch, op.GetTxId(), op.GetN(), true, - tx_destinations); + SetSpentKeyState(batch, op.GetTxId(), op.GetN(), true, + tx_destinations); } MarkDestinationsDirty(tx_destinations); @@ -2065,7 +2065,7 @@ const TxId &txid = GetId(); for (uint32_t i = 0; i < tx->vout.size(); i++) { if (!pwallet->IsSpent(COutPoint(txid, i)) && - (allow_used_addresses || !pwallet->IsUsedDestination(txid, i))) { + (allow_used_addresses || !pwallet->IsSpentKey(txid, i))) { const CTxOut &txout = tx->vout[i]; nCredit += pwallet->GetCredit(txout, filter); if (!MoneyRange(nCredit)) { @@ -2410,7 +2410,7 @@ continue; } - if (!allow_used_addresses && IsUsedDestination(wtxid, i)) { + if (!allow_used_addresses && IsSpentKey(wtxid, i)) { continue; }