aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-11-05 13:17:01 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-11-05 13:17:03 +0100
commit46eb2755d456ca736c1cb7a0922bfece63c5151e (patch)
treee70dbc130a17b3ddd842ce8d47b671a6b31873bf /src/bench
parent69d574ac6c24d85f1f1947bd67cb8c44c2a5f290 (diff)
parent65f3672f3b82a6fa30e5171f85bc8d8a29e0797e (diff)
downloadbitcoin-46eb2755d456ca736c1cb7a0922bfece63c5151e.tar.xz
Merge #14350: Add WalletLocation class
65f3672f3b82a6fa30e5171f85bc8d8a29e0797e wallet: Refactor to use WalletLocation (João Barbosa) 01a4c095c87500650663341533f000c6b613e9da wallet: Add WalletLocation utility class (João Barbosa) Pull request description: Advantages of this change: - avoid resolving wallet absolute path and name repetitively and in multiple places; - avoid calling `GetWalletDir` in multiple places; - extract these details from the actual wallet implementation. The `WalletLocation` class can be a way to represent a wallet not yet loaded that exists in the wallet directory. Tree-SHA512: 71ec09786e038499710e7acafe92d66ab9883fc894964e267443ae9c10a6872a10995c3987a169c436a4e793dae96b28fb97bd7f78483c4b72ac930fa23f8686
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/coin_selection.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp
index 27c23d6834..decdadfb26 100644
--- a/src/bench/coin_selection.cpp
+++ b/src/bench/coin_selection.cpp
@@ -33,7 +33,7 @@ static void addCoin(const CAmount& nValue, const CWallet& wallet, std::vector<Ou
// (https://github.com/bitcoin/bitcoin/issues/7883#issuecomment-224807484)
static void CoinSelection(benchmark::State& state)
{
- const CWallet wallet("dummy", WalletDatabase::CreateDummy());
+ const CWallet wallet(WalletLocation(), WalletDatabase::CreateDummy());
LOCK(wallet.cs_wallet);
// Add coins.
@@ -57,7 +57,7 @@ static void CoinSelection(benchmark::State& state)
}
typedef std::set<CInputCoin> CoinSet;
-static const CWallet testWallet("dummy", WalletDatabase::CreateDummy());
+static const CWallet testWallet(WalletLocation(), WalletDatabase::CreateDummy());
std::vector<std::unique_ptr<CWalletTx>> wtxn;
// Copied from src/wallet/test/coinselector_tests.cpp