From 2320fe5099518a30dab75f5a4dcd03974553fd83 Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Wed, 15 May 2019 20:24:54 +0200 Subject: [PATCH] added more stat in wallet logs --- src/gui/qt-daemon/application/daemon_backend.cpp | 2 +- src/rpc/core_rpc_server_commands_defs.h | 2 ++ src/wallet/wallet2.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/qt-daemon/application/daemon_backend.cpp b/src/gui/qt-daemon/application/daemon_backend.cpp index b518be67..07a3b5a4 100644 --- a/src/gui/qt-daemon/application/daemon_backend.cpp +++ b/src/gui/qt-daemon/application/daemon_backend.cpp @@ -1546,7 +1546,7 @@ void daemon_backend::wallet_vs_options::worker_func() { w->get()->build_minted_block(ctx.sp, ctx.rsp); } - LOG_PRINT_L1(w->get()->get_log_prefix() + " PoS mint iteration finished(" << ctx.rsp.status << ")"); + LOG_PRINT_L1(w->get()->get_log_prefix() + " PoS mint iteration finished(iterations: " << ctx.rsp.iterations_processed << "," << ctx.rsp.status << ")"); return true; }); } diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index fe143042..01da849a 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -1084,6 +1084,7 @@ namespace currency uint64_t starter_timestamp; crypto::hash last_block_hash; bool is_pos_allowed; + uint64_t iterations_processed; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(status) @@ -1091,6 +1092,7 @@ namespace currency KV_SERIALIZE(block_timestamp) KV_SERIALIZE(height) KV_SERIALIZE(is_pos_allowed) + KV_SERIALIZE(iterations_processed) KV_SERIALIZE(starter_timestamp) KV_SERIALIZE_VAL_POD_AS_BLOB(last_block_hash); END_KV_SERIALIZE_MAP() diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 05c4230d..ee92ebac 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -1014,7 +1014,7 @@ namespace tools cxt.rsp.status = CORE_RPC_STATUS_NOT_FOUND; uint64_t timstamp_start = runtime_config.get_core_time(); uint64_t timstamp_last_idle_call = runtime_config.get_core_time(); - + cxt.rsp.iterations_processed = 0; for (size_t i = 0; i != cxt.sp.pos_entries.size(); i++) { @@ -1080,6 +1080,7 @@ namespace tools { PROFILE_FUNC("check_hash"); check_hash_res = currency::check_hash(kernel_hash, this_coin_diff); + ++cxt.rsp.iterations_processed; } if (check_hash_res) {