From 9df8d7cd967c7b234c8b067bf8a7c630daf6738c Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Thu, 11 Dec 2025 01:06:05 +0100 Subject: [PATCH] cork range batches --- lib/core.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core.js b/lib/core.js index 989c2daf5..12a670059 100644 --- a/lib/core.js +++ b/lib/core.js @@ -526,6 +526,7 @@ module.exports = class Core { this._setBitfieldRanges(start, end, value) } + if (verifies.length > 0) this.replicator.cork() for (let i = 0; i < verifies.length; i++) { const bitfield = verifies[i] && verifies[i].bitfield if (bitfield) { @@ -533,6 +534,7 @@ module.exports = class Core { this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop) } } + if (verifies.length > 0) this.replicator.uncork() if (this.hintsChanged) await this.flushHints() } finally {