diff --git a/changelog.md b/changelog.md index 445560fdb4..b2d6b20d4c 100644 --- a/changelog.md +++ b/changelog.md @@ -37,6 +37,7 @@ The `zetacored` binary must be upgraded to trigger chain parameters data migrati * [4509](https://github.com/zeta-chain/node/pull/4509) - use outbound schedule interval in sui cctx scheduling * [4514](https://github.com/zeta-chain/node/pull/4514) - use Zeta height as a factor to calculate the EVM chain artificial height for TSS keysign * [4513](https://github.com/zeta-chain/node/pull/4513) - use `outbound_schedule_interval` and `outbound_schedule_lookahead` in ton cctx scheduling +* [4641](https://github.com/zeta-chain/node/pull/4641) - fix busy-loop goroutine leak in `newPendingTransactions` websocket subscriptions after unsubscribe/disconnect ### Tests diff --git a/rpc/websockets.go b/rpc/websockets.go index 39f111bbda..fd330dc647 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -734,7 +734,11 @@ func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn, subID rpc.ID) errCh := sub.Err() for { select { - case ev := <-txsCh: + case ev, ok := <-txsCh: + if !ok { + return + } + data, ok := ev.Data.(cmttypes.EventDataTx) if !ok { api.logger.Debug("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data))