aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2022-08-07 20:56:17 -0400
committerSuhas Daftuar <sdaftuar@gmail.com>2022-08-23 16:05:00 -0400
commited470940cddbeb40425960d51cefeec4948febe4 (patch)
tree91f598eec25c5714404c3c085a0e3d98be9cb73c /src/test
parent84852bb6bb3579e475ce78fe729fd125ddbc715f (diff)
downloadbitcoin-ed470940cddbeb40425960d51cefeec4948febe4.tar.xz
Add functions to construct locators without CChain
This introduces an insignificant performance penalty, as it means locator construction needs to use the skiplist-based CBlockIndex::GetAncestor() function instead of the lookup-based CChain, but avoids the need for callers to have access to a relevant CChain object.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/skiplist_tests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/skiplist_tests.cpp b/src/test/skiplist_tests.cpp
index 3d3fd5d93d..9f5e3ab7ae 100644
--- a/src/test/skiplist_tests.cpp
+++ b/src/test/skiplist_tests.cpp
@@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(getlocator_test)
for (int n=0; n<100; n++) {
int r = InsecureRandRange(150000);
CBlockIndex* tip = (r < 100000) ? &vBlocksMain[r] : &vBlocksSide[r - 100000];
- CBlockLocator locator = chain.GetLocator(tip);
+ CBlockLocator locator = GetLocator(tip);
// The first result must be the block itself, the last one must be genesis.
BOOST_CHECK(locator.vHave.front() == tip->GetBlockHash());