Skip to content

Emit peer-bitfield when a peer's bitfield or range message is processed#848

Open
gmaclennan wants to merge 1 commit into
holepunchto:mainfrom
gmaclennan:add-peer-bitfield-event
Open

Emit peer-bitfield when a peer's bitfield or range message is processed#848
gmaclennan wants to merge 1 commit into
holepunchto:mainfrom
gmaclennan:add-peer-bitfield-event

Conversation

@gmaclennan

Copy link
Copy Markdown
Contributor

There is currently no way to observe when a peer's remote bitfield is updated by an incoming bitfield or range message. The existing remote-contiguous-length event covers only the aggregate storage hint, not per-peer state.

This PR emits a peer-bitfield session event, mirroring peer-add/peer-remove, from both handlers after the remote bitfield state has been updated.

No behavior change; observability only.

Use case: CoMapeo derives per-peer sync progress (how many blocks each connected device has and still needs) from peers' remote bitfields, and needs a change signal to know when to re-derive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant