core, eth, les, trie: add a prefix to contract code (#21080)
This commit is contained in:
@ -28,6 +28,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/trie"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -540,7 +541,7 @@ func (f *BlockFetcher) loop() {
|
||||
announce.time = task.time
|
||||
|
||||
// If the block is empty (header only), short circuit into the final import queue
|
||||
if header.TxHash == types.DeriveSha(types.Transactions{}) && header.UncleHash == types.CalcUncleHash([]*types.Header{}) {
|
||||
if header.TxHash == types.EmptyRootHash && header.UncleHash == types.EmptyUncleHash {
|
||||
log.Trace("Block empty, skipping body retrieval", "peer", announce.origin, "number", header.Number, "hash", header.Hash())
|
||||
|
||||
block := types.NewBlockWithHeader(header)
|
||||
@ -619,7 +620,7 @@ func (f *BlockFetcher) loop() {
|
||||
continue
|
||||
}
|
||||
if txnHash == (common.Hash{}) {
|
||||
txnHash = types.DeriveSha(types.Transactions(task.transactions[i]))
|
||||
txnHash = types.DeriveSha(types.Transactions(task.transactions[i]), new(trie.Trie))
|
||||
}
|
||||
if txnHash != announce.header.TxHash {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user