hypercore 11.30.0 → 11.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/replicator.js +3 -1
- package/lib/verifier.js +5 -0
- package/package.json +1 -1
package/lib/replicator.js
CHANGED
|
@@ -2451,14 +2451,16 @@ module.exports = class Replicator {
|
|
|
2451
2451
|
|
|
2452
2452
|
if (this._manifestPeer === peer) this._manifestPeer = null
|
|
2453
2453
|
|
|
2454
|
+
let inflight = false
|
|
2454
2455
|
for (const req of this._inflight) {
|
|
2455
2456
|
if (req.peer !== peer) continue
|
|
2457
|
+
inflight = true
|
|
2456
2458
|
this._inflight.remove(req.id, true)
|
|
2457
2459
|
this._clearRequest(peer, req)
|
|
2458
2460
|
}
|
|
2459
2461
|
|
|
2460
2462
|
this._onpeerupdate(false, peer)
|
|
2461
|
-
this.updateAll()
|
|
2463
|
+
if (inflight) this.updateAll()
|
|
2462
2464
|
}
|
|
2463
2465
|
|
|
2464
2466
|
_queueBlock(b) {
|
package/lib/verifier.js
CHANGED
|
@@ -214,6 +214,11 @@ module.exports = class Verifier {
|
|
|
214
214
|
static createManifest(inp) {
|
|
215
215
|
if (!inp) return null
|
|
216
216
|
|
|
217
|
+
if (inp.quorum && inp.quorum < 0) throw BAD_ARGUMENT('Quorum cannot be negative')
|
|
218
|
+
if (inp.quorum && inp.signers && inp.quorum > inp.signers.length) {
|
|
219
|
+
throw BAD_ARGUMENT('Quorum should not be higher than the number of signers')
|
|
220
|
+
}
|
|
221
|
+
|
|
217
222
|
const manifest = {
|
|
218
223
|
version: getManifestVersion(inp), // defaults to v1
|
|
219
224
|
hash: 'blake2b',
|