test: mark last zmq block before rpc calls
This commit is contained in:
parent
31da32ecfd
commit
c4649c9b13
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue