Skip to content

Commit

Permalink
fix: data race
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Nov 8, 2024
1 parent 0f4bb48 commit 701eacf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpc/grpc/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func (blockAPI *BlockAPI) retryNewBlocksSubscription(ctx context.Context) (bool,
}

func (blockAPI *BlockAPI) broadcastToListeners(ctx context.Context, height int64, hash []byte) {
blockAPI.Lock()
defer blockAPI.Unlock()
defer func() {
if r := recover(); r != nil {
core.GetEnvironment().Logger.Debug("failed to write to heights listener", "err", r)
Expand Down

0 comments on commit 701eacf

Please sign in to comment.