diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-07-25 14:43:26 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-07-25 14:44:19 +0200 |
commit | 88af2276876868fc5b17a67ecaa86b219969d4c6 (patch) | |
tree | 47629f5fe0b56c9eaa9c6856f28fe3053be3aa50 | |
parent | 1caafa6cde3b88d926611771f9b4c06fcc6e0007 (diff) |
test: Make sure wallet.backup is created in temp path
This assures that we don't overwrite a random file called
`wallet.backup` that happens to be in the current directory. It also
assures that the temporary file will be cleaned up.
Noticed by Evan Klitzke, came up in discussion here:
https://github.com/bitcoin/bitcoin/pull/10880#discussion_r128460722
-rw-r--r-- | src/wallet/test/wallet_tests.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 8176a0017c..4a2cc9a139 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -469,7 +469,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) JSONRPCRequest request; request.params.setArray(); - request.params.push_back("wallet.backup"); + request.params.push_back((pathTemp / "wallet.backup").string()); vpwallets.insert(vpwallets.begin(), &wallet); ::dumpwallet(request); } @@ -481,7 +481,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) JSONRPCRequest request; request.params.setArray(); - request.params.push_back("wallet.backup"); + request.params.push_back((pathTemp / "wallet.backup").string()); vpwallets[0] = &wallet; ::importwallet(request); |