@@ -25,6 +25,7 @@ import (
25
25
"github.com/ethereum/go-ethereum/core"
26
26
"github.com/ethereum/go-ethereum/core/rawdb"
27
27
"github.com/ethereum/go-ethereum/core/state/snapshot"
28
+ "github.com/ethereum/go-ethereum/core/txpool"
28
29
"github.com/ethereum/go-ethereum/core/types"
29
30
"github.com/ethereum/go-ethereum/eth/downloader"
30
31
"github.com/ethereum/go-ethereum/eth/protocols/arb"
@@ -382,7 +383,7 @@ func (h *ethHandler) Chain() *core.BlockChain { return h.chain }
382
383
383
384
type dummyTxPool struct {}
384
385
385
- func (d * dummyTxPool ) Get (hash common.Hash ) * types .Transaction {
386
+ func (d * dummyTxPool ) Get (hash common.Hash ) * txpool .Transaction {
386
387
return nil
387
388
}
388
389
@@ -480,7 +481,11 @@ func (h *snapHandler) AccountIterator(root, account common.Hash) (snapshot.Accou
480
481
log .Error ("Failed to open trie" , "root" , root , "err" , err )
481
482
return nil , err
482
483
}
483
- accIter := t .NodeIterator (account [:])
484
+ accIter , err := t .NodeIterator (account [:])
485
+ if err != nil {
486
+ log .Error ("Failed to open nodeIterator for trie" , "root" , root , "err" , err )
487
+ return nil , err
488
+ }
484
489
return trieAccountIterator {trieIteratorWrapper {
485
490
iter : trie .NewIterator ((accIter )),
486
491
}}, nil
@@ -521,8 +526,13 @@ func (h *snapHandler) StorageIterator(root, account, origin common.Hash) (snapsh
521
526
log .Error ("Failed to open storage trie" , "root" , acc .Root , "err" , err )
522
527
return nil , err
523
528
}
529
+ nodeIter , err := storageTrie .NodeIterator (origin [:])
530
+ if err != nil {
531
+ log .Error ("Failed node iterator to open storage trie" , "root" , acc .Root , "err" , err )
532
+ return nil , err
533
+ }
524
534
return trieStoreageIterator {trieIteratorWrapper {
525
- iter : trie .NewIterator (storageTrie . NodeIterator ( origin [:]) ),
535
+ iter : trie .NewIterator (nodeIter ),
526
536
}}, nil
527
537
}
528
538
0 commit comments