mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-10 13:13:27 +01:00
Merge pull request #1252
2f4f6c7
daemon: do not divide by 0 when the pool is empty (moneromooo-monero)
This commit is contained in:
commit
6fa35e3539
@ -873,10 +873,10 @@ bool t_rpc_command_executor::print_transaction_pool_stats() {
|
|||||||
if (tx_info.last_failed_height)
|
if (tx_info.last_failed_height)
|
||||||
++n_failing;
|
++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
|
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;
|
<< 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;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user