aboutsummaryrefslogtreecommitdiff
path: root/src/bench/bench_bitcoin.cpp
diff options
context:
space:
mode:
authornijynot <nijynot@gmail.com>2019-10-26 17:03:30 +0200
committernijynot <nijynot@gmail.com>2019-10-28 13:07:38 +0100
commit3bb0a4674f74d22043c7911ea76ab8a4d93fed62 (patch)
tree6385c489ffe7ead367972228e792b42eabef028f /src/bench/bench_bitcoin.cpp
parent7b701fef58f627956d597817a1f9422edd890cdc (diff)
bench: Fix negative values and zero for -evals flag
Diffstat (limited to 'src/bench/bench_bitcoin.cpp')
-rw-r--r--src/bench/bench_bitcoin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bench/bench_bitcoin.cpp b/src/bench/bench_bitcoin.cpp
index d0d7c03ee1..655a5a3459 100644
--- a/src/bench/bench_bitcoin.cpp
+++ b/src/bench/bench_bitcoin.cpp
@@ -51,6 +51,13 @@ int main(int argc, char** argv)
std::string scaling_str = gArgs.GetArg("-scaling", DEFAULT_BENCH_SCALING);
bool is_list_only = gArgs.GetBoolArg("-list", false);
+ if (evaluations == 0) {
+ return EXIT_SUCCESS;
+ } else if (evaluations < 0) {
+ tfm::format(std::cerr, "Error parsing evaluations argument: %d\n", evaluations);
+ return EXIT_FAILURE;
+ }
+
double scaling_factor;
if (!ParseDouble(scaling_str, &scaling_factor)) {
tfm::format(std::cerr, "Error parsing scaling factor as double: %s\n", scaling_str.c_str());