Skip to content

Commit

Permalink
Bugfix: Properly store locked coinbase receipt status
Browse files Browse the repository at this point in the history
  • Loading branch information
jdowning100 committed Feb 13, 2025
1 parent a3ca9c5 commit 96f7d19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/types/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
var (
receiptStatusFailedRLP = []byte{}
receiptStatusSuccessfulRLP = []byte{0x01}
receiptStatusLockedRLP = []byte{0x02}
)

// This error is returned when a typed receipt is decoded, but the string is empty.
Expand Down Expand Up @@ -183,6 +184,8 @@ func (r *Receipt) setStatus(postStateOrStatus []byte) error {
r.Status = ReceiptStatusSuccessful
case bytes.Equal(postStateOrStatus, receiptStatusFailedRLP):
r.Status = ReceiptStatusFailed
case bytes.Equal(postStateOrStatus, receiptStatusLockedRLP):
r.Status = ReceiptStatusLocked
case len(postStateOrStatus) == len(common.Hash{}):
r.PostState = postStateOrStatus
default:
Expand All @@ -195,6 +198,8 @@ func (r *Receipt) statusEncoding() []byte {
if len(r.PostState) == 0 {
if r.Status == ReceiptStatusFailed {
return receiptStatusFailedRLP
} else if r.Status == ReceiptStatusLocked {
return receiptStatusLockedRLP
}
return receiptStatusSuccessfulRLP
}
Expand Down

0 comments on commit 96f7d19

Please sign in to comment.