diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-10-23 20:05:13 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-10-23 20:05:13 +0100 |
commit | 2f4f6c7c26a5fd23047e58b7b107a59212280cd5 (patch) | |
tree | 433f37db3ace4fecf6cb7f89809faaf2e5d1bb18 /src/daemon | |
parent | Merge pull request #1245 (diff) | |
download | monero-2f4f6c7c26a5fd23047e58b7b107a59212280cd5.tar.xz |
daemon: do not divide by 0 when the pool is empty
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/rpc_command_executor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 8c6d5dec4..e7c4d10bc 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -873,10 +873,10 @@ bool t_rpc_command_executor::print_transaction_pool_stats() { if (tx_info.last_failed_height) ++n_failing; } - size_t avg_bytes = bytes / n_transactions; + size_t n_transactions ? avg_bytes = bytes / n_transactions : 0; tools::msg_writer() << n_transactions << " tx(es), " << bytes << " bytes total (min " << min_bytes << ", max " << max_bytes << ", avg " << avg_bytes << ")" << std::endl - << "fees " << cryptonote::print_money(fee) << " (avg " << cryptonote::print_money(fee / n_transactions) << " per tx)" << std::endl + << "fees " << cryptonote::print_money(fee) << " (avg " << cryptonote::print_money(n_transactions ? fee / n_transactions : 0) << " per tx)" << std::endl << n_not_relayed << " not relayed, " << n_failing << " failing, " << n_10m << " older than 10 minutes (oldest " << (oldest == 0 ? "-" : get_human_time_ago(oldest, now)) << ")" << std::endl; return true; |