Skip to content

Commit

Permalink
tests: Fix dangling pwalletMain pointer in wallet tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laanwj committed Feb 27, 2017
1 parent c7e57ce commit 75a1093
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wallet/test/wallet_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)

{
CWallet wallet;
CWallet *backup = ::pwalletMain;
::pwalletMain = &wallet;
UniValue key;
key.setObject();
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 75a1093

Please sign in to comment.