diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2020-01-22 16:53:42 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2020-03-31 08:36:02 -0500 |
commit | c0d07dc4cba7634cde4e8bf586557772f3248a42 (patch) | |
tree | e8a1326bb11fa6578cdd90d6cb23306190245307 /src/interfaces/chain.h | |
parent | 1be8ff280c78c30baabae9429c53c0bebb89c44d (diff) | |
download | bitcoin-c0d07dc4cba7634cde4e8bf586557772f3248a42.tar.xz |
wallet: Avoid use of Chain::Lock in CWallet::ScanForWalletTransactions
This is a step toward removing the Chain::Lock class and reducing cs_main
locking.
This change affects behavior in a few small ways.
- If there's no max_height specified, percentage progress is measured ending at
wallet last processed block instead of node tip
- More consistent error reporting: Early check to see if start_block is on the
active chain is removed, so start_block is always read and the triggers an
error if it's unavailable
Diffstat (limited to 'src/interfaces/chain.h')
-rw-r--r-- | src/interfaces/chain.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index 8bc0ed824c..ef5a002f54 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -148,6 +148,11 @@ public: //! information. virtual bool findFirstBlockWithTimeAndHeight(int64_t min_time, int min_height, const FoundBlock& block={}) = 0; + //! Find next block if block is part of current chain. Also flag if + //! there was a reorg and the specified block hash is no longer in the + //! current chain, and optionally return block information. + virtual bool findNextBlock(const uint256& block_hash, int block_height, const FoundBlock& next={}, bool* reorg=nullptr) = 0; + //! Find ancestor of block at specified height and optionally return //! ancestor information. virtual bool findAncestorByHeight(const uint256& block_hash, int ancestor_height, const FoundBlock& ancestor_out={}) = 0; |