Always do the check for and removal of sync msg

This commit is contained in:
joeuhren
2021-01-01 18:33:53 -07:00
parent ca52b10f59
commit 0dc7613cba
+6 -12
View File
@@ -320,18 +320,15 @@ if (database == 'peers') {
console.log('index cleared (reindex)');
});
// Check if there are more than 1000 blocks to index
var showSync = check_show_sync_message(stats.count);
// Check if there are more than 1000 blocks to index and show a sync msg
check_show_sync_message(stats.count);
db.update_tx_db(settings.coin, 1, stats.count, stats.txes, settings.update_timeout, function() {
db.update_richlist('received', function() {
db.update_richlist('balance', function() {
db.get_stats(settings.coin, function(nstats) {
// Check if the sync msg was showing
if (showSync) {
// Remove the sync msg
// always check for and remove the sync msg if exists
remove_sync_message();
}
// update richlist_last_updated value
db.update_last_updated_stats(settings.coin, { richlist_last_updated: Math.floor(new Date() / 1000) }, function (cb) {
// update blockchain_last_updated value
@@ -361,18 +358,15 @@ if (database == 'peers') {
var last = (stats.last ? stats.last : 0);
// Get the total number of blocks
var count = (stats.count ? stats.count : 0);
// Check if there are more than 1000 blocks to index
var showSync = check_show_sync_message(count - last);
// Check if there are more than 1000 blocks to index and show a sync msg
check_show_sync_message(count - last);
db.update_tx_db(settings.coin, last, count, stats.txes, settings.update_timeout, function(){
db.update_richlist('received', function(){
db.update_richlist('balance', function(){
db.get_stats(settings.coin, function(nstats){
// Check if the sync msg was showing
if (showSync) {
// Remove the sync msg
// always check for and remove the sync msg if exists
remove_sync_message();
}
// update richlist_last_updated value
db.update_last_updated_stats(settings.coin, { richlist_last_updated: Math.floor(new Date() / 1000) }, function (cb) {
// update blockchain_last_updated value