mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02: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:
parent
f7ba881bc6
commit
3cb85ac594
4 changed files with 27 additions and 7 deletions
|
|
@ -47,6 +47,18 @@ BOOST_AUTO_TEST_CASE(findBlock)
|
|||
BOOST_CHECK(!chain->findBlock({}, FoundBlock()));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findFirstBlockWithTimeAndHeight)
|
||||
{
|
||||
auto chain = interfaces::MakeChain(m_node);
|
||||
auto& active = ChainActive();
|
||||
uint256 hash;
|
||||
int height;
|
||||
BOOST_CHECK(chain->findFirstBlockWithTimeAndHeight(/* min_time= */ 0, /* min_height= */ 5, FoundBlock().hash(hash).height(height)));
|
||||
BOOST_CHECK_EQUAL(hash, active[5]->GetBlockHash());
|
||||
BOOST_CHECK_EQUAL(height, 5);
|
||||
BOOST_CHECK(!chain->findFirstBlockWithTimeAndHeight(/* min_time= */ active.Tip()->GetBlockTimeMax() + 1, /* min_height= */ 0));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(findAncestorByHeight)
|
||||
{
|
||||
auto chain = interfaces::MakeChain(m_node);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue