Skip to content

Commit

Permalink
Merge pull request #5423 from oasisprotocol/kostko/fix/consensus-ligh…
Browse files Browse the repository at this point in the history
…tblock-nil
  • Loading branch information
kostko authored Nov 1, 2023
2 parents 357eab8 + 772a182 commit 1285238
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changelog/5423.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
go/consensus: Do not crash on nil result from Commit

The Commit function can return both a nil error and a nil result in case
the given block is not available yet.
2 changes: 1 addition & 1 deletion go/consensus/cometbft/full/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ func (n *commonNode) getLightBlock(ctx context.Context, height int64, allowPendi
}

commit, err := cmtcore.Commit(n.rpcCtx, &tmHeight)
if err == nil && commit.Header != nil {
if err == nil && commit != nil && commit.Header != nil {
lb.SignedHeader = &commit.SignedHeader
tmHeight = commit.Header.Height
} else if allowPending {
Expand Down

0 comments on commit 1285238

Please sign in to comment.