peer: only request cmpctblock if we received sendcmpct.

This commit is contained in:
Christopher Jeffrey 2017-01-29 16:26:36 -08:00
parent fae56d1387
commit cc6ccfe9d9
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1407,9 +1407,11 @@ Peer.prototype.blockType = function blockType() {
return invTypes.FILTERED_BLOCK; return invTypes.FILTERED_BLOCK;
if (this.options.compact) { if (this.options.compact) {
if (this.hasCompact()) if (this.hasCompact() && this.compactMode !== -1) {
if (!this.options.hasWitness() || this.compactWitness)
return invTypes.CMPCT_BLOCK; return invTypes.CMPCT_BLOCK;
} }
}
if (this.hasWitness()) if (this.hasWitness())
return invTypes.WITNESS_BLOCK; return invTypes.WITNESS_BLOCK;