diff --git a/index.js b/index.js index f80b9bfd..81e07af4 100644 --- a/index.js +++ b/index.js @@ -607,7 +607,13 @@ module.exports = class Hypercore extends EventEmitter { } if (bitfield) { - this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop) + const contig = this.core.header.contiguousLength + + if (bitfield.start < contig && !bitfield.drop) { + this.replicator.onhave(0, contig, false) + } else { + this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop) + } } if (value) {