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 78144e6 commit 4d08a39
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 4d08a39

Please sign in to comment.