retesteth: enable maxResults in AccountRange (#20020)

This commit is contained in:
winsvega 2019-09-02 12:49:49 +03:00 committed by Martin Holst Swende
parent d5bd38384c
commit cedf8be435

View File

@ -679,7 +679,7 @@ func (api *RetestethAPI) AccountRange(ctx context.Context,
}
it := trie.NewIterator(accountTrie.NodeIterator(common.BigToHash((*big.Int)(addressHash)).Bytes()))
result := AccountRangeResult{AddressMap: make(map[common.Hash]common.Address)}
for i := 0; /*i < int(maxResults) && */ it.Next(); i++ {
for i := 0; i < int(maxResults) && it.Next(); i++ {
if preimage := accountTrie.GetKey(it.Key); preimage != nil {
result.AddressMap[common.BytesToHash(it.Key)] = common.BytesToAddress(preimage)
//fmt.Printf("%x: %x\n", it.Key, preimage)