mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
wallet refactor: Avoid use of Chain::Lock in CWallet::RescanFromTime
This is a step toward removing the Chain::Lock class and reducing cs_main locking. This change has no effect on behavior.
This commit is contained in:
@@ -260,6 +260,11 @@ public:
|
||||
WAIT_LOCK(cs_main, lock);
|
||||
return FillBlock(LookupBlockIndex(hash), block, lock);
|
||||
}
|
||||
bool findFirstBlockWithTimeAndHeight(int64_t min_time, int min_height, const FoundBlock& block) override
|
||||
{
|
||||
WAIT_LOCK(cs_main, lock);
|
||||
return FillBlock(ChainActive().FindEarliestAtLeast(min_time, min_height), block, lock);
|
||||
}
|
||||
bool findAncestorByHeight(const uint256& block_hash, int ancestor_height, const FoundBlock& ancestor_out) override
|
||||
{
|
||||
WAIT_LOCK(cs_main, lock);
|
||||
|
||||
@@ -146,6 +146,12 @@ public:
|
||||
//! or contents.
|
||||
virtual bool findBlock(const uint256& hash, const FoundBlock& block={}) = 0;
|
||||
|
||||
//! Find first block in the chain with timestamp >= the given time
|
||||
//! and height >= than the given height, return false if there is no block
|
||||
//! with a high enough timestamp and height. Optionally return block
|
||||
//! information.
|
||||
virtual bool findFirstBlockWithTimeAndHeight(int64_t min_time, int min_height, const FoundBlock& block={}) = 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;
|
||||
|
||||
Reference in New Issue
Block a user