go-ethereum
go-ethereum copied to clipboard
fix(event): handle empty subscription list in JoinSubscriptions
Fix
JoinSubscriptions would block indefinitely when called with zero subscriptions. The select statement had no cases that could complete since no goroutines were spawned to send errors.
Changes
- Add early return for empty subscription list in
JoinSubscriptions - Return a subscription that waits for
unsubbedchannel closure, allowing proper cleanup without blocking - Add
TestMultisubEmptyto verify the fix and prevent regression