mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 07:01:44 +00:00
tests: Fix dangling pwalletMain pointer in wallet tests
Github-Pull: #9875 Rebased-From: 75a109338fbbe9a30c54d76010b538c8ac1080ac
This commit is contained in:
parent
eddaa6b35d
commit
50953c2aad
@ -397,6 +397,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
|
||||
|
||||
{
|
||||
CWallet wallet;
|
||||
CWallet *backup = ::pwalletMain;
|
||||
::pwalletMain = &wallet;
|
||||
UniValue key;
|
||||
key.setObject();
|
||||
@ -412,6 +413,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
|
||||
|
||||
UniValue response = importmulti(request);
|
||||
BOOST_CHECK_EQUAL(response.write(), strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Failed to rescan before time %d, transactions may be missing.\"}}]", newTip->GetBlockTimeMax()));
|
||||
::pwalletMain = backup;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user