diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-04-18 11:30:20 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-04-18 11:30:24 +0200 |
| commit | 0d12570a80378ed9a340043115e399a431351067 (patch) | |
| tree | 21a83269dbc389d44ec7080438cca592856e4bf0 /src/wallet/test/wallet_tests.cpp | |
| parent | Merge #12715: depends: Add 'make clean' rule (diff) | |
| parent | test: Fix dangling wallet pointer in vpwallets (diff) | |
| download | discoin-0d12570a80378ed9a340043115e399a431351067.tar.xz discoin-0d12570a80378ed9a340043115e399a431351067.zip | |
Merge #13007: test: Fix dangling wallet pointer in vpwallets
d41a420 test: Fix dangling wallet pointer in vpwallets (João Barbosa)
Pull request description:
Tree-SHA512: 83e4ec571f1675b3dab6f7606f29d6fae495d998b4e5794ff14315943783d4518cfa66eba4113293e349eb74aa22a024b21272fdb29c212477edb4c09aec9fa7
Diffstat (limited to 'src/wallet/test/wallet_tests.cpp')
| -rw-r--r-- | src/wallet/test/wallet_tests.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index be7e39639..57705926a 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -142,6 +142,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) request.params.push_back((pathTemp / "wallet.backup").string()); vpwallets.insert(vpwallets.begin(), &wallet); ::dumpwallet(request); + vpwallets.erase(vpwallets.begin()); } // Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME @@ -152,8 +153,9 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) JSONRPCRequest request; request.params.setArray(); request.params.push_back((pathTemp / "wallet.backup").string()); - vpwallets[0] = &wallet; + vpwallets.insert(vpwallets.begin(), &wallet); ::importwallet(request); + vpwallets.erase(vpwallets.begin()); LOCK(wallet.cs_wallet); BOOST_CHECK_EQUAL(wallet.mapWallet.size(), 3U); @@ -166,7 +168,6 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) } SetMockTime(0); - vpwallets.erase(vpwallets.begin()); } // Check that GetImmatureCredit() returns a newly calculated value instead of |