bip151: minor refactor.

This commit is contained in:
Christopher Jeffrey 2016-07-26 02:18:40 -07:00
parent c597d7c411
commit b7c280a84c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -85,7 +85,7 @@ BIP151Stream.prototype.maybeRekey = function maybeRekey(data) {
if (now >= this.lastRekey + 10
|| this.processed >= this.highWaterMark) {
this.lastRekey = utils.now();
this.lastRekey = now;
this.processed = 0;
this.emit('rekey');
this.rekey();
@ -349,13 +349,11 @@ BIP151.prototype.encinit = function encinit(data) {
var cipher = p.readU8();
assert(!this.initReceived, 'Already initialized.');
this.initReceived = true;
assert(cipher === this.output.cipher, 'Cipher mismatch.');
this.output.init(publicKey);
this.initReceived = true;
return this;
};
BIP151.prototype.toEncack = function toEncack(writer) {