Skip to content

Commit bfd0d55

Browse files
committed
User friendly full sync console log message
1 parent 41091d4 commit bfd0d55

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tools/sync.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ var syncChain = function(config, web3, blockHashOrNumber) {
6262
console.log('Warning: null block data received from the block with hash/number: ' + blockHashOrNumber);
6363
}else{
6464
if(config.lastSynced === 0){
65-
console.log('No Last Sync Found');
65+
console.log('No last full sync record found, start from block: latest');
6666
writeBlockToDB(config, blockData);
6767
writeTransactionsToDB(config, blockData);
6868
var lastSync = blockData.number;
6969
updateLastSynced(config, lastSync);
7070
}else{
71-
console.log('Found existing last Sync');
71+
console.log('Found last full sync record: ' + config.lastSynced);
7272
writeBlockToDB(config, blockData);
7373
writeTransactionsToDB(config, blockData);
7474
var lastSync = config.lastSynced - 1;
@@ -79,7 +79,6 @@ var syncChain = function(config, web3, blockHashOrNumber) {
7979
}else{
8080
console.log('Error: Web3 connection time out trying to get block ' + blockHashOrNumber + ' retrying connection now');
8181
syncChain(config, web3, blockHashOrNumber);
82-
return;
8382
}
8483
};
8584
/**
@@ -90,7 +89,7 @@ var writeBlockToDB = function(config, blockData) {
9089
if ( typeof err !== 'undefined' && err ) {
9190
if (err.code == 11000) {
9291
if(!('quiet' in config && config.quiet === true)) {
93-
console.log('Skip: Duplicate key ' + blockData.number.toString() + ': ' + err);
92+
console.log('Skip: Duplicate key ' + blockData.number.toString() + ': ' + err);
9493
}
9594
} else {
9695
console.log('Error: Aborted due to error on ' + 'block number ' + blockData.number.toString() + ': ' + err);

0 commit comments

Comments
 (0)