Skip to content

Commit 75a1093

Browse files
committed
tests: Fix dangling pwalletMain pointer in wallet tests
1 parent c7e57ce commit 75a1093

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wallet/test/wallet_tests.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
397397

398398
{
399399
CWallet wallet;
400+
CWallet *backup = ::pwalletMain;
400401
::pwalletMain = &wallet;
401402
UniValue key;
402403
key.setObject();
@@ -412,6 +413,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
412413

413414
UniValue response = importmulti(request);
414415
BOOST_CHECK_EQUAL(response.write(), strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Failed to rescan before time %d, transactions may be missing.\"}}]", newTip->GetBlockTimeMax()));
416+
::pwalletMain = backup;
415417
}
416418
}
417419

0 commit comments

Comments
 (0)