ethclient: delete check empty tx root hash

This commit is contained in:
ian 2021-08-23 23:13:08 +08:00
parent 436ed45548
commit bb0e439bb6

View file

@ -124,9 +124,6 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
if head.UncleHash != types.EmptyUncleHash && len(body.UncleHashes) == 0 { if head.UncleHash != types.EmptyUncleHash && len(body.UncleHashes) == 0 {
return nil, fmt.Errorf("server returned empty uncle list but block header indicates uncles") return nil, fmt.Errorf("server returned empty uncle list but block header indicates uncles")
} }
if head.TxHash == types.EmptyRootHash && len(body.Transactions) > 0 {
return nil, fmt.Errorf("server returned non-empty transaction list but block header indicates no transactions")
}
if head.TxHash != types.EmptyRootHash && len(body.Transactions) == 0 { if head.TxHash != types.EmptyRootHash && len(body.Transactions) == 0 {
return nil, fmt.Errorf("server returned empty transaction list but block header indicates transactions") return nil, fmt.Errorf("server returned empty transaction list but block header indicates transactions")
} }