changeset 26727:35a733e36477

Merge #9875: tests: Fix dangling pwalletMain pointer in wallet tests 75a1093 tests: Fix dangling pwalletMain pointer in wallet tests (Wladimir J. van der Laan) Tree-SHA512: 7fb6e8385fe7d542f9ecb113a08d675ca9e84907a1939b3a6ad41318fda55bc999b9bc8ffc3f56cd8610ca49d0db982d3c793df7bbcb7eb9638f4483030db6a8
author Wladimir J. van der Laan <laanwj@gmail.com>
date Mon, 27 Feb 2017 13:25:08 +0100
parents f563b742362e daeaf26696bb
children 7a3b3bf954ae 72be9cfc5db9 67c26ed67c54 89235ad59c76 ff393633f50d
files
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/wallet/test/wallet_tests.cpp	Mon Feb 27 08:44:32 2017 +0100
+++ b/src/wallet/test/wallet_tests.cpp	Mon Feb 27 13:25:08 2017 +0100
@@ -397,6 +397,7 @@
 
     {
         CWallet wallet;
+        CWallet *backup = ::pwalletMain;
         ::pwalletMain = &wallet;
         UniValue key;
         key.setObject();
@@ -412,6 +413,7 @@
 
         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;
     }
 }