aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-07-24 13:57:06 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-07-24 13:57:06 -0500
commite3de4aa68bedf7a7adfaf53cc2c132a74dc7fb08 (patch)
tree134d499069659c6bbbfd372d32d45a93ea718184 /src/blockchain_db
parentMerge pull request #5473 (diff)
parentremove unused code (diff)
downloadmonero-e3de4aa68bedf7a7adfaf53cc2c132a74dc7fb08.tar.xz
Merge pull request #5502
25a7cfd add a few checks where it seems appropriate (moneromooo-monero) 1a66a86 remove unused code (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index d0fd787db..784fabf4a 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -707,7 +707,7 @@ uint64_t BlockchainLMDB::get_estimated_batch_size(uint64_t batch_num_blocks, uin
++num_blocks_used;
}
if (my_rtxn) block_rtxn_stop();
- avg_block_size = total_block_size / num_blocks_used;
+ avg_block_size = total_block_size / (num_blocks_used ? num_blocks_used : 1);
MDEBUG("average block size across recent " << num_blocks_used << " blocks: " << avg_block_size);
}
estim: