add load-wallet benchmark

This commit is contained in:
Ariel Gabizon
2017-09-18 21:54:53 +02:00
parent d1bba6f1b6
commit 2e8aefdce1
4 changed files with 56 additions and 2 deletions

View File

@@ -2602,6 +2602,11 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp)
}
auto amount = AmountFromValue(params[2]);
sample_times.push_back(benchmark_sendtoaddress(amount));
} else if (benchmarktype == "loadwallet") {
if (Params().NetworkIDString() != "regtest") {
throw JSONRPCError(RPC_TYPE_ERROR, "Benchmark must be run in regtest mode");
}
sample_times.push_back(benchmark_loadwallet());
} else {
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid benchmarktype");
}