mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-01 04:28:37 +00:00
core/txpool/blobpool: check the first byte on legacy tx check
This commit is contained in:
parent
723e7304b8
commit
f814ec33a3
1 changed files with 3 additions and 4 deletions
|
|
@ -719,10 +719,9 @@ func (p *BlobPool) Close() error {
|
||||||
func (p *BlobPool) parseTransaction(id uint64, size uint32, blob []byte) (bool, error) {
|
func (p *BlobPool) parseTransaction(id uint64, size uint32, blob []byte) (bool, error) {
|
||||||
var ptx blobTxForPool
|
var ptx blobTxForPool
|
||||||
if err := rlp.DecodeBytes(blob, &ptx); err != nil {
|
if err := rlp.DecodeBytes(blob, &ptx); err != nil {
|
||||||
kind, _, _, splitErr := rlp.Split(blob)
|
kind, content, _, splitErr := rlp.Split(blob)
|
||||||
if splitErr == nil && kind == rlp.String {
|
// check whether it is legacy tx type
|
||||||
// legacy transaction is an RLP string
|
if splitErr == nil && kind == rlp.String && len(content) > 1 && content[0] == 3 {
|
||||||
// while blobTxForPool is encoded as an RLP list.
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return false, err
|
return false, err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue