aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-29 16:51:39 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-29 20:52:40 +0000
commit25a7cfdb4a4e652c7d0a0f93333d60b0b9d186d1 (patch)
tree28c3bdb49aafb1c27bc08378ab91ccd7d91a6c48 /src/blockchain_db
parentMerge pull request #5486 (diff)
downloadmonero-25a7cfdb4a4e652c7d0a0f93333d60b0b9d186d1.tar.xz
add a few checks where it seems appropriate
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 340434888..3278c7387 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: