bip151: set processed to zero on rekey.

This commit is contained in:
Christopher Jeffrey 2016-07-26 01:14:35 -07:00
parent f37946abb7
commit 018241fc78
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -83,10 +83,10 @@ BIP151Stream.prototype.maybeRekey = function maybeRekey(data) {
this.processed += data.length;
if (now > this.lastRekey + 10
if (now >= this.lastRekey + 10
|| this.processed >= this.highWaterMark) {
this.lastRekey = utils.now();
this.processed -= this.highWaterMark;
this.processed = 0;
this.emit('rekey');
this.rekey();
}