HomePhabricator

Merge #11039: Avoid second mapWallet lookup

Description

Merge #11039: Avoid second mapWallet lookup

Summary:
8f2f1e0 wallet: Avoid second mapWallet lookup (João Barbosa)

Pull request description:

All calls to `mapWallet.count()` have the intent to detect if a `txid` exists and most are followed by a second lookup to retrieve the `CWalletTx`.

This PR replaces all `mapWallet.count()` calls with `mapWallet.find()` to avoid the second lookup.

Tree-SHA512: 96b7de7f5520ebf789a1aec1949a4e9c74e13683869cee012f717e5be8e51097d068e2347a36e89097c9a89f1ed1a1529db71760dac9b572e36a3e9ac1155f29

Backport of Core PR 11039
https://github.com/bitcoin/bitcoin/pull/11039/files
Completes T550
Depends on D2689

Test Plan:
ninja check
test_runner.py

Reviewers: deadalnix, Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Subscribers: teamcity, schancel

Differential Revision: https://reviews.bitcoinabc.org/D2690

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Aug 18 2017, 14:15
jasonbcoxCommitted on Mar 16 2019, 15:46
jasonbcoxPushed on Mar 16 2019, 15:46
Reviewer
Restricted Project
Differential Revision
D2690: Merge #11039: Avoid second mapWallet lookup
Parents
rABCd1c1b1620a48: Merge #9622: [rpc] listsinceblock should include lost transactions when…
Branches
Unknown
Tags
Unknown

Event Timeline