bitcoind: prevent rapid tip updates for all networks

This commit is contained in:
Braydon Fuller 2016-04-11 10:15:12 -04:00
parent 5bea36edc6
commit 019626ba15
1 changed files with 8 additions and 12 deletions

View File

@ -322,8 +322,7 @@ Bitcoin.prototype._zmqBlockHandler = function(node, message) {
}
}
// Prevent a rapid succession of updates with regtest
if (self.node.network.regtestEnabled) {
// Prevent a rapid succession of updates
if (new Date() - self.zmqLastBlock > 1000) {
self.zmqLastBlock = new Date();
updateChain();
@ -333,9 +332,6 @@ Bitcoin.prototype._zmqBlockHandler = function(node, message) {
updateChain();
}, 1000);
}
} else {
updateChain();
}
// Notify block subscribers
for (var i = 0; i < this.subscriptions.block.length; i++) {