No change in behavior.
wallet, refactor: Remove duplicate/unnecessary lookups #19279
pull promag wants to merge 3 commits into bitcoin:master from promag:2020-06-wallet-duplicate-lookups changing 1 files +5 −9-
promag commented at 11:35 PM on June 14, 2020: member
-
wallet, refactor: Remove duplicate mapTxSpends lookup 6ec0a69c12
-
wallet, refactor: Remove duplicate set lookup 642e8a5cb3
-
wallet, doc: Fix typo though to through bad0f4d608
- fanquake added the label Wallet on Jun 14, 2020
- fanquake requested review from achow101 on Jun 15, 2020
-
DrahtBot commented at 5:46 AM on June 15, 2020: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #16910 (wallet: reduce loading time by using unordered maps by achow101)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
- promag closed this on Jun 15, 2020
- promag reopened this on Jun 15, 2020
-
in src/wallet/wallet.cpp:1021 in 642e8a5cb3 outdated
1017 | @@ -1018,9 +1018,7 @@ bool CWallet::AbandonTransaction(const uint256& hashTx) 1018 | // Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too 1019 | TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0)); 1020 | while (iter != mapTxSpends.end() && iter->first.hash == now) { 1021 | - if (!done.count(iter->second)) { 1022 | - todo.insert(iter->second); 1023 | - } 1024 | + todo.emplace(iter->second);
meshcollider commented at 11:52 AM on July 11, 2020:I'm not sure if I understand this change, but the first check is in the set
donenottodoso it isn't obvious to me why this is correct
MarcoFalke commented at 11:57 AM on July 11, 2020:I think the assumption is that sha256 hashes don't collide, but I agree the explanation/reasoning can be a bit more verbose
promag closed this on Jul 12, 2020promag deleted the branch on Jul 12, 2020DrahtBot locked this on Feb 15, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me