From cc6ccfe9d9fca987074ad43d1648015befec6fc0 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 29 Jan 2017 16:26:36 -0800 Subject: [PATCH] peer: only request cmpctblock if we received sendcmpct. --- lib/net/peer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/net/peer.js b/lib/net/peer.js index 57aa71e0..53e015b1 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -1407,8 +1407,10 @@ Peer.prototype.blockType = function blockType() { return invTypes.FILTERED_BLOCK; if (this.options.compact) { - if (this.hasCompact()) - return invTypes.CMPCT_BLOCK; + if (this.hasCompact() && this.compactMode !== -1) { + if (!this.options.hasWitness() || this.compactWitness) + return invTypes.CMPCT_BLOCK; + } } if (this.hasWitness())