rpc: return a Next hash even without a preimage

This commit is contained in:
Guillaume Ballet 2019-07-10 12:23:50 +02:00
parent 795cfed5c0
commit 99e7ebe37c

View file

@ -19,7 +19,6 @@ package eth
import (
"compress/gzip"
"context"
"encoding/hex"
"errors"
"fmt"
"io"
@ -363,11 +362,7 @@ func accountRange(st state.Trie, start *common.Hash, maxResults int) (AccountRan
}
if it.Next() {
if preimage := st.GetKey(it.Key); preimage != nil {
result.Next = common.BytesToHash(it.Key)
} else {
return AccountRangeResult{}, fmt.Errorf("preimage not found for 0x%s", hex.EncodeToString(it.Key))
}
result.Next = common.BytesToHash(it.Key)
}
return result, nil