wallet: Avoid use of Chain::Lock in CWallet::GetKeyBirthTimes

This is a step toward removing the Chain::Lock class and reducing cs_main
locking.

This change only affects behavior in the case where wallet last block processed
falls behind the chain tip, where it will treat the last block processed as the
current tip.
This commit is contained in:
Russell Yanofsky
2020-01-22 17:15:17 -05:00
parent e958ff9ab5
commit 48973402d8
3 changed files with 15 additions and 20 deletions

View File

@@ -80,13 +80,6 @@ class LockImpl : public Chain::Lock, public UniqueLock<RecursiveMutex>
assert(block != nullptr);
return block->GetBlockHash();
}
int64_t getBlockTime(int height) override
{
LockAssertion lock(::cs_main);
CBlockIndex* block = ::ChainActive()[height];
assert(block != nullptr);
return block->GetBlockTime();
}
bool haveBlockOnDisk(int height) override
{
LockAssertion lock(::cs_main);