Benchmark time to call sendtoaddress with many UTXOs

This commit is contained in:
Jack Grigg
2017-08-17 10:31:47 +01:00
parent 02dd675a25
commit a76174b76b
5 changed files with 157 additions and 9 deletions

View File

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