peer: timeout bip150 and bip151 properly.
This commit is contained in:
parent
f2d092f23c
commit
120ceef984
@ -1440,6 +1440,7 @@ Peer.prototype.onPacket = co(function* onPacket(packet) {
|
|||||||
throw new Error('Destroyed peer sent a packet.');
|
throw new Error('Destroyed peer sent a packet.');
|
||||||
|
|
||||||
if (this.bip151
|
if (this.bip151
|
||||||
|
&& this.bip151.job
|
||||||
&& !this.bip151.completed
|
&& !this.bip151.completed
|
||||||
&& packet.type !== packetTypes.ENCINIT
|
&& packet.type !== packetTypes.ENCINIT
|
||||||
&& packet.type !== packetTypes.ENCACK) {
|
&& packet.type !== packetTypes.ENCACK) {
|
||||||
@ -1447,6 +1448,7 @@ Peer.prototype.onPacket = co(function* onPacket(packet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.bip150
|
if (this.bip150
|
||||||
|
&& this.bip150.job
|
||||||
&& !this.bip150.completed
|
&& !this.bip150.completed
|
||||||
&& packet.type !== packetTypes.AUTHCHALLENGE
|
&& packet.type !== packetTypes.AUTHCHALLENGE
|
||||||
&& packet.type !== packetTypes.AUTHREPLY
|
&& packet.type !== packetTypes.AUTHREPLY
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user