Skip to content

Commit

Permalink
fix: potential panic when rpc doesn't return block (#56)
Browse files Browse the repository at this point in the history
Close #52
  • Loading branch information
MattKetmo authored Jan 18, 2024
1 parent 564aa17 commit 1c6b221
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/rpc/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ func (n *Node) syncBlocks(ctx context.Context) {
}

currentBlock := currentBlockResp.Block
if currentBlock == nil {
log.Error().Err(err).Msgf("no block returned when requesting latest block")
return
}

// Check the latest known block height
latestBlockHeight := int64(0)
Expand Down

0 comments on commit 1c6b221

Please sign in to comment.