Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Jul 10, 2024
1 parent 55626c9 commit c94e1c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zetaclient/chains/bitcoin/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func (ob *Observer) postBlockHeader(ctx context.Context, tip int64) error {
ob.logger.Inbound.Info().Msgf("postBlockHeader: tip %d", tip)
bn := tip
chainState, err := ob.ZetacoreClient().GetBlockHeaderChainState(ctx, ob.Chain().ChainId)
if err == nil && chainState.EarliestHeight > 0 {
if err == nil && chainState != nil && chainState.EarliestHeight > 0 {
bn = chainState.LatestHeight + 1

Check warning on line 660 in zetaclient/chains/bitcoin/observer/observer.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/bitcoin/observer/observer.go#L658-L660

Added lines #L658 - L660 were not covered by tests
}
if bn > tip {
Expand Down

0 comments on commit c94e1c8

Please sign in to comment.