aboutsummaryrefslogtreecommitdiff
path: root/src/bench/wallet_create.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bench/wallet_create.cpp')
-rw-r--r--src/bench/wallet_create.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/bench/wallet_create.cpp b/src/bench/wallet_create.cpp
index 32f55f51e1..5c0557bf6f 100644
--- a/src/bench/wallet_create.cpp
+++ b/src/bench/wallet_create.cpp
@@ -2,9 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
-#if defined(HAVE_CONFIG_H)
-#include <config/bitcoin-config.h>
-#endif
+#include <config/bitcoin-config.h> // IWYU pragma: keep
#include <bench/bench.h>
#include <node/context.h>
@@ -36,14 +34,15 @@ static void WalletCreate(benchmark::Bench& bench, bool encrypted)
bilingual_str error_string;
std::vector<bilingual_str> warnings;
- fs::path wallet_path = test_setup->m_path_root / strprintf("test_wallet_%d", random.rand32()).c_str();
+ auto wallet_path = fs::PathToString(test_setup->m_path_root / "test_wallet");
bench.run([&] {
- auto wallet = CreateWallet(context, wallet_path.utf8string(), /*load_on_start=*/std::nullopt, options, status, error_string, warnings);
+ auto wallet = CreateWallet(context, wallet_path, /*load_on_start=*/std::nullopt, options, status, error_string, warnings);
assert(status == DatabaseStatus::SUCCESS);
assert(wallet != nullptr);
- // Cleanup
- wallet.reset();
+ // Release wallet
+ RemoveWallet(context, wallet, /*load_on_start=*/ std::nullopt);
+ UnloadWallet(std::move(wallet));
fs::remove_all(wallet_path);
});
}