[ethereum/go-ethereum] Add AccountRangeAt to debug API (#17438)

jwasinger commented on this pull request.

> + }
+ result = append(result, common.BytesToAddress(key))
+ }
+ return AccountRangeResult{result}, nil
+}
+
+//block hash or number, tx index, start address hash, max results
+func (api *PrivateDebugAPI) AccountRange(ctx context.Context, blockNr uint64, txIndex int, startAddr *common.Address, maxResults int) (AccountRangeResult, error) {
+ zeros := make([]byte, common.HashLength)
+
+ if bytes.Equal(startAddr[:], zeros) {
+ startAddr = nil
+ }
+
+ blockHash := api.eth.blockchain.GetBlockByNumber(blockNr).Hash()
+ _, _, statedb, err := api.computeTxEnv(blockHash, txIndex, 0)

I’m getting an error from this line:

«`
{«jsonrpc»:»2.0″,»id»:1,»error»:{«code»:-32000,»message»:»parent 0000000000000000000000000000000000000000000000000000000000000000 not found»}}
«`

Not sure what I’m doing wrong here.

Добавить комментарий