Skip to content

Commit

Permalink
fix zero height check
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaczanowski committed Feb 23, 2025
1 parent 4fa83eb commit 0fa8a97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/chain_watcher/height_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ func NewStreamingHeightWatcher(ctx context.Context, cosmosClient *cosmos.Client,

case tx := <-txs:
if data, ok := tx.Data.(ctypes.EventDataNewBlock); ok {
height := data.Block.Header.Height
logger.Debugf("Height watcher observed new height: %d", height)
lastHeight = data.Block.Header.Height
logger.Debugf("Height watcher observed new height: %d", lastHeight)
select {
case heights <- NewHeight{
Height: height,
Height: lastHeight,
Error: nil,
}:
// prevents deadlock with heights channel
Expand Down

0 comments on commit 0fa8a97

Please sign in to comment.