mirror of https://codeberg.org/pzp/pzp-sync.git
Merge pull request 'Handle missing remoteWants without throwing' (#9) from missing-remotewant into master
Reviewed-on: https://codeberg.org/pzp/pzp-sync/pulls/9
This commit is contained in:
commit
dbb4bb28e6
|
@ -260,8 +260,7 @@ class SyncStream extends Pipeable {
|
|||
async #sendBloomReq(id, phase, round, remoteBloom, msgIDsForMe) {
|
||||
// prettier-ignore
|
||||
this.#debug('%s Stream IN%s: got bloom round %s plus msgIDs in %s: %o', this.#myId, phase-1, round-1, id, msgIDsForMe)
|
||||
const remoteWantRange = this.#remoteWant.get(id)
|
||||
if (!remoteWantRange) throw new Error(`Remote want-range not set for ${id}`)
|
||||
const remoteWantRange = this.#remoteWant.get(id) ?? [0, 0]
|
||||
this.#updateReceivableMsgs(id, msgIDsForMe)
|
||||
const msgIDsForThem = await this.#algo.getMsgsMissing(
|
||||
id,
|
||||
|
@ -293,8 +292,7 @@ class SyncStream extends Pipeable {
|
|||
async #sendBloomRes(id, phase, round, remoteBloom, msgIDsForMe) {
|
||||
// prettier-ignore
|
||||
this.#debug('%s Stream IN%s: got bloom round %s plus msgIDs in %s: %o', this.#myId, phase-1, round, id, msgIDsForMe)
|
||||
const remoteWantRange = this.#remoteWant.get(id)
|
||||
if (!remoteWantRange) throw new Error(`Remote want-range not set for ${id}`)
|
||||
const remoteWantRange = this.#remoteWant.get(id) ?? [0, 0]
|
||||
this.#updateReceivableMsgs(id, msgIDsForMe)
|
||||
const msgIDsForThem = await this.#algo.getMsgsMissing(
|
||||
id,
|
||||
|
@ -325,8 +323,7 @@ class SyncStream extends Pipeable {
|
|||
async #sendMissingMsgsReq(id, round, remoteBloom, msgIDsForMe) {
|
||||
// prettier-ignore
|
||||
this.#debug('%s Stream IN7: got bloom round %s plus msgIDs in %s: %o', this.#myId, round, id, msgIDsForMe)
|
||||
const remoteWantRange = this.#remoteWant.get(id)
|
||||
if (!remoteWantRange) throw new Error(`Remote want-range not set for ${id}`)
|
||||
const remoteWantRange = this.#remoteWant.get(id) ?? [0, 0]
|
||||
this.#updateReceivableMsgs(id, msgIDsForMe)
|
||||
const msgIDsForThem = await this.#algo.getMsgsMissing(
|
||||
id,
|
||||
|
@ -364,8 +361,7 @@ class SyncStream extends Pipeable {
|
|||
async #sendMissingMsgsRes(id, round, remoteBloom, msgsForMe) {
|
||||
// prettier-ignore
|
||||
this.#debug('%s Stream IN8: got bloom round %s plus %s msgs in %s', this.#myId, round, msgsForMe.length, id)
|
||||
const remoteWantRange = this.#remoteWant.get(id)
|
||||
if (!remoteWantRange) throw new Error(`Remote want-range not set for ${id}`)
|
||||
const remoteWantRange = this.#remoteWant.get(id) ?? [0, 0]
|
||||
const msgIDsForThem = await this.#algo.getMsgsMissing(
|
||||
id,
|
||||
round,
|
||||
|
|
Loading…
Reference in New Issue