Skip to content

Commit

Permalink
Merge pull request #257 from OffchainLabs/fix-deserialize
Browse files Browse the repository at this point in the history
Fix DeserializeHeaderExtraInformation that panics for nil header
  • Loading branch information
anodar authored Sep 26, 2023
2 parents e9028a6 + 45efc82 commit 07732c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/types/arb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func (info HeaderInfo) UpdateHeaderWithInfo(header *Header) {
}

func DeserializeHeaderExtraInformation(header *Header) HeaderInfo {
if header.BaseFee == nil || header.BaseFee.Sign() == 0 || len(header.Extra) != 32 || header.Difficulty.Cmp(common.Big1) != 0 {
if header == nil || header.BaseFee == nil || header.BaseFee.Sign() == 0 || len(header.Extra) != 32 || header.Difficulty.Cmp(common.Big1) != 0 {
// imported blocks have no base fee
// The genesis block doesn't have an ArbOS encoded extra field
return HeaderInfo{}
Expand Down

0 comments on commit 07732c1

Please sign in to comment.