tests: Fix dangling pwalletMain pointer in wallet tests
This commit is contained in:
parent
c7e57ce981
commit
75a109338f
1 changed files with 2 additions and 0 deletions
|
@ -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…
Reference in a new issue