Skip to content

Commit

Permalink
arb handler_p2p: update for geth 1.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Nov 27, 2023
1 parent 571b42d commit 15e55cf
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions arbitrum/handler_p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state/snapshot"
"github.com/ethereum/go-ethereum/core/txpool"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/eth/protocols/arb"
Expand Down Expand Up @@ -382,7 +383,7 @@ func (h *ethHandler) Chain() *core.BlockChain { return h.chain }

type dummyTxPool struct{}

func (d *dummyTxPool) Get(hash common.Hash) *types.Transaction {
func (d *dummyTxPool) Get(hash common.Hash) *txpool.Transaction {
return nil
}

Expand Down Expand Up @@ -480,7 +481,11 @@ func (h *snapHandler) AccountIterator(root, account common.Hash) (snapshot.Accou
log.Error("Failed to open trie", "root", root, "err", err)
return nil, err
}
accIter := t.NodeIterator(account[:])
accIter, err := t.NodeIterator(account[:])
if err != nil {
log.Error("Failed to open nodeIterator for trie", "root", root, "err", err)
return nil, err
}
return trieAccountIterator{trieIteratorWrapper{
iter: trie.NewIterator((accIter)),
}}, nil
Expand Down Expand Up @@ -521,8 +526,13 @@ func (h *snapHandler) StorageIterator(root, account, origin common.Hash) (snapsh
log.Error("Failed to open storage trie", "root", acc.Root, "err", err)
return nil, err
}
nodeIter, err := storageTrie.NodeIterator(origin[:])
if err != nil {
log.Error("Failed node iterator to open storage trie", "root", acc.Root, "err", err)
return nil, err
}
return trieStoreageIterator{trieIteratorWrapper{
iter: trie.NewIterator(storageTrie.NodeIterator(origin[:])),
iter: trie.NewIterator(nodeIter),
}}, nil
}

Expand Down

0 comments on commit 15e55cf

Please sign in to comment.