From f64d701014a801af593480c300da7d28344af4d3 Mon Sep 17 00:00:00 2001 From: suha jin <89185836+djm07073@users.noreply.github.com> Date: Tue, 20 May 2025 17:29:23 +0900 Subject: [PATCH] fix: include start key Update api_debug.go --- eth/api_debug.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eth/api_debug.go b/eth/api_debug.go index 188dee11aa..44974350df 100644 --- a/eth/api_debug.go +++ b/eth/api_debug.go @@ -245,7 +245,7 @@ func storageRangeAt(statedb *state.StateDB, root common.Hash, address common.Add } it := trie.NewIterator(trieIt) result := StorageRangeResult{Storage: storageMap{}} - for i := 0; i < maxResult && it.Next(); i++ { + for range maxResult { _, content, _, err := rlp.Split(it.Value) if err != nil { return StorageRangeResult{}, err @@ -256,6 +256,9 @@ func storageRangeAt(statedb *state.StateDB, root common.Hash, address common.Add e.Key = &preimage } result.Storage[common.BytesToHash(it.Key)] = e + if !it.Next() { + break + } } // Add the 'next key' so clients can continue downloading. if it.Next() {