diff --git a/types/txn.go b/types/txn.go index d713d41e1..2a87632a7 100644 --- a/types/txn.go +++ b/types/txn.go @@ -51,6 +51,7 @@ type TxParseContext struct { Sighash [32]byte Sig [65]byte withSender bool + withBor bool chainIDRequired bool IsProtected bool validateRlp func([]byte) error @@ -64,6 +65,7 @@ func NewTxParseContext(chainID uint256.Int) *TxParseContext { } ctx := &TxParseContext{ withSender: true, + withBor: false, Keccak1: sha3.NewLegacyKeccak256(), Keccak2: sha3.NewLegacyKeccak256(), } @@ -118,6 +120,7 @@ var ErrRlpTooBig = errors.New("txn rlp too big") func (ctx *TxParseContext) ValidateRLP(f func(txnRlp []byte) error) { ctx.validateRlp = f } func (ctx *TxParseContext) WithSender(v bool) { ctx.withSender = v } +func (ctx *TxParseContext) WithBor(v bool) { ctx.withBor = v } func (ctx *TxParseContext) ChainIDRequired() *TxParseContext { ctx.chainIDRequired = true return ctx @@ -263,7 +266,7 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo slot.DataLen = dataLen isDataEmpty := dataLen == 0 - if isEmptyHash && isDataEmpty && legacy { + if ctx.withBor && isEmptyHash && isDataEmpty && legacy { slot.IsBor = true }