Skip to content

Conversation

@Arshia-r-m
Copy link
Contributor

The following test simulates a scenario where a single node functions as the maker, and multiple takers request to open a channel to it. In this case, the node panics!

@zoedberg
Copy link
Member

Thanks for reporting this! It seems there's a bug in the handling of the lock that should protect from multiple open channel requests. I've fixed it, will push it soon, but please first rebase this on top of the latest master tip and rename the test and its file to concurrent_openchannel (please remember also to update the test directory accordingly).

@Arshia-r-m Arshia-r-m force-pushed the test-concurrent-channel-openning branch from 37a0467 to 026dc9b Compare October 23, 2025 12:36
@zoedberg
Copy link
Member

Pushed the fix on top of your commit, merging this.
As you can see the bug was related to an incorrect usage of the unlocked state mutex that exists to protect concurrent calls to the APIs. This was preventing the rgb_send_lock to work properly (to prevent double spends).
To make the test pass I also added a test utility to retry the openchannel request in case it receives a forbidden error.
Finally I also improved a bit the handle event code, where we can now leverage the ReplayEvent error to allow retrying events when an error occurs.

@zoedberg zoedberg merged commit a546002 into RGB-Tools:master Oct 24, 2025
9 of 12 checks passed
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.

2 participants