Changeset View
Changeset View
Standalone View
Standalone View
src/bench/wallet_balance.cpp
Show All 15 Lines | static void WalletBalance(benchmark::State &state, const bool set_dirty, | ||||
const bool add_watchonly, const bool add_mine) { | const bool add_watchonly, const bool add_mine) { | ||||
const auto &ADDRESS_WATCHONLY = ADDRESS_BCHREG_UNSPENDABLE; | const auto &ADDRESS_WATCHONLY = ADDRESS_BCHREG_UNSPENDABLE; | ||||
const Config &config = GetConfig(); | const Config &config = GetConfig(); | ||||
NodeContext node; | NodeContext node; | ||||
std::unique_ptr<interfaces::Chain> chain = | std::unique_ptr<interfaces::Chain> chain = | ||||
interfaces::MakeChain(node, config.GetChainParams()); | interfaces::MakeChain(node, config.GetChainParams()); | ||||
CWallet wallet{config.GetChainParams(), chain.get(), WalletLocation(), | CWallet wallet{chain.get(), WalletLocation(), WalletDatabase::CreateMock()}; | ||||
WalletDatabase::CreateMock()}; | |||||
{ | { | ||||
wallet.SetupLegacyScriptPubKeyMan(); | wallet.SetupLegacyScriptPubKeyMan(); | ||||
bool first_run; | bool first_run; | ||||
if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) { | if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) { | ||||
assert(false); | assert(false); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |