Fix negative stat value issue after attempted sync
-Better error handling of update_db() -Fixes an issue that can cause some stats values to get set to a negative number when running an index sync and the wallet daemon has not finished loading the blockchain yet (If this happens to you, stop the explorer, apply this fix with `git pull` to make sure it doesn't happen again, then run a reindex-txcount and reindex-last to restore the proper values)
This commit is contained in:
+2
-1
@@ -828,7 +828,8 @@ module.exports = {
|
||||
// updates stats data for given coin; called by sync.js
|
||||
update_db: function(coin, cb) {
|
||||
lib.get_blockcount( function (count) {
|
||||
if (!count) {
|
||||
// check to ensure count is a positive number
|
||||
if (!count || (count != null && typeof count === 'number' && count < 0)) {
|
||||
console.log('Unable to connect to explorer API');
|
||||
return cb(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user