Index/Update improvement
-Shifted some of the code around to be run in a better order (for example, blockchain_last_updated date is set right after finishing the blockchain sync instead of at the very end of the reindex)
This commit is contained in:
+12
-11
@@ -374,17 +374,18 @@ if (database == 'peers') {
|
|||||||
check_show_sync_message(count - last);
|
check_show_sync_message(count - last);
|
||||||
|
|
||||||
db.update_tx_db(settings.coin.name, last, count, stats.txes, settings.sync.update_timeout, false, function() {
|
db.update_tx_db(settings.coin.name, last, count, stats.txes, settings.sync.update_timeout, false, function() {
|
||||||
db.update_richlist('received', function() {
|
// update blockchain_last_updated value
|
||||||
db.update_richlist('balance', function() {
|
db.update_last_updated_stats(settings.coin.name, { blockchain_last_updated: Math.floor(new Date() / 1000) }, function (cb) {
|
||||||
db.get_stats(settings.coin.name, function(nstats) {
|
db.update_richlist('received', function() {
|
||||||
// check for and update heavycoin data if applicable
|
db.update_richlist('balance', function() {
|
||||||
update_heavy(settings.coin.name, stats.count, 20, settings.blockchain_specific.heavycoin.enabled, function(heavy) {
|
// update richlist_last_updated value
|
||||||
// always check for and remove the sync msg if exists
|
db.update_last_updated_stats(settings.coin.name, { richlist_last_updated: Math.floor(new Date() / 1000) }, function (cb) {
|
||||||
remove_sync_message();
|
db.get_stats(settings.coin.name, function(nstats) {
|
||||||
// update richlist_last_updated value
|
// check for and update heavycoin data if applicable
|
||||||
db.update_last_updated_stats(settings.coin.name, { richlist_last_updated: Math.floor(new Date() / 1000) }, function (cb) {
|
update_heavy(settings.coin.name, stats.count, 20, settings.blockchain_specific.heavycoin.enabled, function(heavy) {
|
||||||
// update blockchain_last_updated value
|
// always check for and remove the sync msg if exists
|
||||||
db.update_last_updated_stats(settings.coin.name, { blockchain_last_updated: Math.floor(new Date() / 1000) }, function (cb) {
|
remove_sync_message();
|
||||||
|
|
||||||
console.log('update complete (block: %s)', nstats.last);
|
console.log('update complete (block: %s)', nstats.last);
|
||||||
exit();
|
exit();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user