Changeset View
Changeset View
Standalone View
Standalone View
src/bench/wallet_balance.cpp
Show All 20 Lines | static void WalletBalance(benchmark::State &state, const bool set_dirty, | ||||
std::unique_ptr<interfaces::Chain> chain = interfaces::MakeChain(node); | std::unique_ptr<interfaces::Chain> chain = interfaces::MakeChain(node); | ||||
CWallet wallet{config.GetChainParams(), chain.get(), WalletLocation(), | CWallet wallet{config.GetChainParams(), chain.get(), WalletLocation(), | ||||
WalletDatabase::CreateMock()}; | WalletDatabase::CreateMock()}; | ||||
{ | { | ||||
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); | ||||
} | } | ||||
wallet.handleNotifications(); | |||||
} | } | ||||
auto handler = chain->handleNotifications({&wallet, [](CWallet *) {}}); | |||||
const Optional<std::string> address_mine{ | const Optional<std::string> address_mine{ | ||||
add_mine ? Optional<std::string>{getnewaddress(config, wallet)} | add_mine ? Optional<std::string>{getnewaddress(config, wallet)} | ||||
: nullopt}; | : nullopt}; | ||||
if (add_watchonly) { | if (add_watchonly) { | ||||
importaddress(wallet, ADDRESS_WATCHONLY); | importaddress(wallet, ADDRESS_WATCHONLY); | ||||
} | } | ||||
for (int i = 0; i < 100; ++i) { | for (int i = 0; i < 100; ++i) { | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |