core, eth, les, trie: add a prefix to contract code (#21080)
This commit is contained in:
@ -22,6 +22,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
@ -70,7 +71,8 @@ func (db *odrDatabase) ContractCode(addrHash, codeHash common.Hash) ([]byte, err
|
||||
if codeHash == sha3Nil {
|
||||
return nil, nil
|
||||
}
|
||||
if code, err := db.backend.Database().Get(codeHash[:]); err == nil {
|
||||
code := rawdb.ReadCode(db.backend.Database(), codeHash)
|
||||
if len(code) != 0 {
|
||||
return code, nil
|
||||
}
|
||||
id := *db.id
|
||||
|
Reference in New Issue
Block a user