diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index aadc3500..39be1c69 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -28,3 +28,4 @@ program](https://hackerone.com/tendermint). - [config] \#3868 move misplaced `max_msg_bytes` into mempool section - [store] \#3893 register block amino, not just crypto +- [rpc] [\#3910](https://github.com/tendermint/tendermint/pull/3910) protect subscription access from race conditions (@gchaincl) diff --git a/rpc/client/httpclient.go b/rpc/client/httpclient.go index 85f065b6..c4334523 100644 --- a/rpc/client/httpclient.go +++ b/rpc/client/httpclient.go @@ -453,6 +453,8 @@ func (w *WSEvents) UnsubscribeAll(ctx context.Context, subscriber string) error func (w *WSEvents) redoSubscriptionsAfter(d time.Duration) { time.Sleep(d) + w.mtx.RLock() + defer w.mtx.RUnlock() for q := range w.subscriptions { err := w.ws.Subscribe(context.Background(), q) if err != nil {