diff options
author | Andrew Chow <github@achow101.com> | 2023-01-11 18:18:10 -0500 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-01-11 18:24:53 -0500 |
commit | fbe5e1220a35c35a668ec965c66508a7839aa7dd (patch) | |
tree | 36b6da2dffd1a7dd276fad60712a48c27ade6632 /src/wallet | |
parent | 2f6a8e5e02465e9de5c9f6202d5e3f8aa19bf70b (diff) | |
parent | f9ce0eadf4eb58d1e2207c27fabe69a5642482e7 (diff) | |
download | bitcoin-fbe5e1220a35c35a668ec965c66508a7839aa7dd.tar.xz |
Merge bitcoin/bitcoin#26675: wallet: For feebump, ignore abandoned descendant spends
f9ce0eadf4eb58d1e2207c27fabe69a5642482e7 For feebump, ignore abandoned descendant spends (John Moffett)
Pull request description:
Closes #26667
To be eligible for fee-bumping, a transaction must not have any of its outputs (eg - change) spent in other unconfirmed transactions in the wallet. This behavior is currently [enforced](https://github.com/bitcoin/bitcoin/blob/9e229a542ff2107be43eff2e4b992841367f0366/src/wallet/feebumper.cpp#L25-L28) and [tested](https://github.com/bitcoin/bitcoin/blob/9e229a542ff2107be43eff2e4b992841367f0366/test/functional/wallet_bumpfee.py#L270-L286).
However, this check shouldn't apply to spends in abandoned descendant transactions, as explained by #26667.
`CWallet::IsSpent` already carves out an exception for abandoned transactions, so we can just use that.
I've also added a new test to cover this case.
ACKs for top commit:
Sjors:
re-utACK f9ce0eadf4eb58d1e2207c27fabe69a5642482e7
achow101:
ACK f9ce0eadf4eb58d1e2207c27fabe69a5642482e7
furszy:
ACK f9ce0ead
Tree-SHA512: 19d957d1cf6747668bb114e27a305027bfca5a9bed2b1d9cc9e1b0bd4666486c7c4b60b045a7fe677eb9734d746f5de76390781fb1e9e0bceb4a46d20acd1749
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0f761fb01a..6158ff033c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -647,8 +647,7 @@ bool CWallet::HasWalletSpend(const CTransactionRef& tx) const AssertLockHeld(cs_wallet); const uint256& txid = tx->GetHash(); for (unsigned int i = 0; i < tx->vout.size(); ++i) { - auto iter = mapTxSpends.find(COutPoint(txid, i)); - if (iter != mapTxSpends.end()) { + if (IsSpent(COutPoint(txid, i))) { return true; } } |