aboutsummaryrefslogtreecommitdiff
path: root/src/test/interfaces_tests.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-01-21 15:55:19 -0500
committerRussell Yanofsky <russ@yanofsky.org>2020-03-31 08:36:02 -0500
commit3cb85ac594f115db99f96b0a0f4bfdcd69ef0590 (patch)
treeb815246e12776e63a0bb1bca50cbc12728434eb6 /src/test/interfaces_tests.cpp
parentf7ba881bc669451a60fedac58a449794702a3e23 (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.cpp12
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);