net: only add timeouts for outbound peers.

This commit is contained in:
Christopher Jeffrey 2017-01-10 18:03:02 -08:00
parent a6c1e8c339
commit dbaae30700
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1093,6 +1093,9 @@ Peer.prototype.maybeStall = function maybeStall() {
Peer.prototype.addTimeout = function addTimeout(packet) {
var timeout = Peer.RESPONSE_TIMEOUT;
if (!this.outbound)
return;
switch (packet.type) {
case packetTypes.MEMPOOL:
this.request(packetTypes.INV, timeout);