Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ func (tx *Transaction) encodeTyped(w *bytes.Buffer) error {
// For legacy transactions, it returns the RLP encoding. For EIP-2718 typed
// transactions, it returns the type and payload.
func (tx *Transaction) MarshalBinary() ([]byte, error) {
if tx.inner == nil {
return nil, fmt.Errorf("tx inner data is nil")
}
if tx.Type() == LegacyTxType {
return rlp.EncodeToBytes(tx.inner)
}
Expand Down
Loading