forked from cerc-io/plugeth
core, eth, trie, light: clean up trie interface (#26388)
* all: cleanup trie interface * eth, trie: address comments
This commit is contained in:
@@ -417,7 +417,7 @@ func ServiceGetStorageRangesQuery(chain *core.BlockChain, req *GetStorageRangesP
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
acc, err := accTrie.TryGetAccountWithPreHashedKey(account[:])
|
||||
acc, err := accTrie.TryGetAccountByHash(account)
|
||||
if err != nil || acc == nil {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -523,7 +523,7 @@ func ServiceGetTrieNodesQuery(chain *core.BlockChain, req *GetTrieNodesPacket, s
|
||||
if snap == nil {
|
||||
// We don't have the requested state snapshotted yet (or it is stale),
|
||||
// but can look up the account via the trie instead.
|
||||
account, err := accTrie.TryGetAccountWithPreHashedKey(pathset[0])
|
||||
account, err := accTrie.TryGetAccountByHash(common.BytesToHash(pathset[0]))
|
||||
loads += 8 // We don't know the exact cost of lookup, this is an estimate
|
||||
if err != nil || account == nil {
|
||||
break
|
||||
|
||||
@@ -3083,7 +3083,7 @@ func (t *healRequestSort) Swap(i, j int) {
|
||||
func (t *healRequestSort) Merge() []TrieNodePathSet {
|
||||
var result []TrieNodePathSet
|
||||
for _, path := range t.syncPaths {
|
||||
pathset := TrieNodePathSet([][]byte(path))
|
||||
pathset := TrieNodePathSet(path)
|
||||
if len(path) == 1 {
|
||||
// It's an account reference.
|
||||
result = append(result, pathset)
|
||||
|
||||
Reference in New Issue
Block a user