Skip to content

Commit

Permalink
Guard against drop 0, contig
Browse files Browse the repository at this point in the history
  • Loading branch information
LuKks committed Jul 6, 2023
1 parent 6f07eb4 commit fcd9812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ module.exports = class Hypercore extends EventEmitter {
if (bitfield) {
const contig = this.core.header.contiguousLength

if (bitfield.start < contig) {
this.replicator.onhave(0, contig, bitfield.drop)
if (bitfield.start < contig && !bitfield.drop) {
this.replicator.onhave(0, contig, false)
} else {
this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop)
}
Expand Down

0 comments on commit fcd9812

Please sign in to comment.