We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BitInterlude
_verifyShared()
1 parent 5713481 commit 9052e51Copy full SHA for 9052e51
lib/core.js
@@ -458,15 +458,12 @@ module.exports = class Core {
458
if (batch.commitable()) batch.commit(tx)
459
}
460
461
- bits.flush(tx, this.replicator.localBitfield)
+ const ranges = bits.flush(tx, this.replicator.localBitfield)
462
463
await this.state.flush()
464
465
- for (let i = 0; i < verifies.length; i++) {
466
- const bitfield = verifies[i] && verifies[i].bitfield
467
- if (bitfield) {
468
- this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop)
469
- }
+ for (const range of ranges) {
+ this.replicator.onhave(range.start, range.end - range.start, !range.value)
470
471
} finally {
472
this.state._clearActiveBatch()
0 commit comments