test: mark last zmq block before rpc calls

This commit is contained in:
Braydon Fuller 2016-04-07 15:00:09 -04:00
parent 31da32ecfd
commit c4649c9b13
1 changed files with 1 additions and 1 deletions

View File

@ -242,7 +242,6 @@ Bitcoin.prototype._zmqBlockHandler = function(node, message) {
return log.error(err);
}
self.height = response.result.height;
self.zmqLastBlock = new Date();
$.checkState(self.height >= 0);
self.emit('tip', self.height);
});
@ -261,6 +260,7 @@ Bitcoin.prototype._zmqBlockHandler = function(node, message) {
// Prevent a rapid succession of updates with regtest
if (self.node.network.regtestEnabled) {
if (new Date() - self.zmqLastBlock > 1000) {
self.zmqLastBlock = new Date();
updateChain();
} else {
clearTimeout(self.zmqUpdateTipTimeout);