Check mode no longer updates the last block height

-Also add output displaying which block is currently being checked as before it was almost impossible to determine what, if anything was happening in check mode
This commit is contained in:
Joe Uhren
2021-11-21 18:09:06 -07:00
parent 930b9c4eca
commit e5e1887401
3 changed files with 8 additions and 6 deletions
+4 -2
View File
@@ -955,7 +955,7 @@ module.exports = {
},
// updates tx, address & richlist db's; called by sync.js
update_tx_db: function(coin, start, end, txes, timeout, cb) {
update_tx_db: function(coin, start, end, txes, timeout, check_only, cb) {
var complete = false;
var blocks_to_scan = [];
var task_limit_blocks = settings.sync.block_parallel_tasks;
@@ -972,11 +972,13 @@ module.exports = {
blocks_to_scan.push(i);
async.eachLimit(blocks_to_scan, task_limit_blocks, function(block_height, next_block) {
if (block_height % settings.sync.save_stats_after_sync_blocks === 0) {
if (!check_only && block_height % settings.sync.save_stats_after_sync_blocks === 0) {
Stats.updateOne({coin: coin}, {
last: block_height - 1,
txes: txes
}, function() {});
} else if (check_only) {
console.log('checking block ' + block_height + '...');
}
lib.get_blockhash(block_height, function(blockhash) {