bip151: set processed to zero on rekey.
This commit is contained in:
parent
f37946abb7
commit
018241fc78
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user