diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2020-01-21 15:55:19 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2020-03-31 08:36:02 -0500 |
commit | 3cb85ac594f115db99f96b0a0f4bfdcd69ef0590 (patch) | |
tree | b815246e12776e63a0bb1bca50cbc12728434eb6 /src/test/interfaces_tests.cpp | |
parent | f7ba881bc669451a60fedac58a449794702a3e23 (diff) |
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.
Diffstat (limited to 'src/test/interfaces_tests.cpp')
-rw-r--r-- | src/test/interfaces_tests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/interfaces_tests.cpp b/src/test/interfaces_tests.cpp index f95743ec40..b398b5819d 100644 --- a/src/test/interfaces_tests.cpp +++ b/src/test/interfaces_tests.cpp @@ -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); |