mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
correct terminology
This commit is contained in:
parent
f70beaf822
commit
6b4bcbfcb4
1 changed files with 7 additions and 8 deletions
15
eth/api.go
15
eth/api.go
|
|
@ -336,20 +336,20 @@ func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccountRangeResult struct {
|
type AccountRangeResult struct {
|
||||||
Addresses []common.Address `json:"addresses"`
|
Addresses []common.Address `json:"addresses"`
|
||||||
Next common.Address `json:"next"`
|
Next common.Address `json:"next"`
|
||||||
Preimages []common.Hash `json:"preimages"`
|
Images []common.Hash `json:"preimages"`
|
||||||
NextPreimage common.Hash `json:"nextPreimage"`
|
NextImage common.Hash `json:"nextPreimage"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func accountRange(st state.Trie, start *common.Address, maxResult int) (AccountRangeResult, error) {
|
func accountRange(st state.Trie, start *common.Address, maxResult int) (AccountRangeResult, error) {
|
||||||
it := trie.NewIterator(st.NodeIterator(crypto.Keccak256(start[:])))
|
it := trie.NewIterator(st.NodeIterator(crypto.Keccak256(start[:])))
|
||||||
result := AccountRangeResult{Addresses: []common.Address{}, Next: common.Address{}, Preimages: []common.Hash{}, NextPreimage: common.Hash{}}
|
result := AccountRangeResult{Addresses: []common.Address{}, Next: common.Address{}, Images: []common.Hash{}, NextImage: common.Hash{}}
|
||||||
for i := 0; i < maxResult && it.Next(); i++ {
|
for i := 0; i < maxResult && it.Next(); i++ {
|
||||||
if preimage := st.GetKey(it.Key); preimage != nil {
|
if preimage := st.GetKey(it.Key); preimage != nil {
|
||||||
result.Addresses = append(result.Addresses, common.BytesToAddress(preimage))
|
result.Addresses = append(result.Addresses, common.BytesToAddress(preimage))
|
||||||
} else {
|
} else {
|
||||||
result.Preimages = append(result.Preimages, common.BytesToHash(preimage))
|
result.Images = append(result.Images, common.BytesToHash(it.Key))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,9 +357,8 @@ func accountRange(st state.Trie, start *common.Address, maxResult int) (AccountR
|
||||||
if preimage := st.GetKey(it.Key); preimage != nil {
|
if preimage := st.GetKey(it.Key); preimage != nil {
|
||||||
result.Next = common.BytesToAddress(st.GetKey(preimage))
|
result.Next = common.BytesToAddress(st.GetKey(preimage))
|
||||||
} else {
|
} else {
|
||||||
result.NextPreimage = common.BytesToHash(preimage)
|
result.NextImage = common.BytesToHash(it.Key)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue