Skip to content

Commit 6485466

Browse files
committed
test: Report InitBlockIndex result
If InitBlockIndex fails, then it will segfault later. Same for the later ActivateBestChain. BOOST_REQUIRE the result, so that an error will be reported and the test case aborted.
1 parent 65d90f5 commit 6485466

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/test_bitcoin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
6969
pblocktree = new CBlockTreeDB(1 << 20, true);
7070
pcoinsdbview = new CCoinsViewDB(1 << 23, true);
7171
pcoinsTip = new CCoinsViewCache(pcoinsdbview);
72-
InitBlockIndex(chainparams);
72+
BOOST_REQUIRE(InitBlockIndex(chainparams));
7373
{
7474
CValidationState state;
7575
bool ok = ActivateBestChain(state, chainparams);
76-
BOOST_CHECK(ok);
76+
BOOST_REQUIRE(ok);
7777
}
7878
nScriptCheckThreads = 3;
7979
for (int i=0; i < nScriptCheckThreads-1; i++)

0 commit comments

Comments
 (0)