Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance LND mocking interface to support multiple subscribers #675

Closed
GeorgeTsagk opened this issue Dec 19, 2023 · 0 comments · Fixed by #634
Closed

Enhance LND mocking interface to support multiple subscribers #675

GeorgeTsagk opened this issue Dec 19, 2023 · 0 comments · Fixed by #634
Assignees

Comments

@GeorgeTsagk
Copy link
Member

Description

Our current mocking of lnd subscriptions involves single golang channels (e.g the epochChannel) which are used by various lnd subscription calls like RegisterBlockEpochNtfn which currently simply reads from that channel (e.g reading from the epochChannel).

This causes issues when more than one subscribers are listening for updates from a mocked interface, as the order of reading from the channel is not guaranteed by golang.

Solution

We should enhance the internals of such mocked interfaces to instead use channel structures rather than a single channel
e.g

map[int32] chan int32

in order to guarantee exact delivery of updates to all subscribers.

@GeorgeTsagk GeorgeTsagk self-assigned this Dec 19, 2023
@GeorgeTsagk GeorgeTsagk mentioned this issue Jan 9, 2024
2 tasks
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 a pull request may close this issue.

1 participant