mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-21 22:24:32 +00:00
parent
655f975bbb
commit
7464f0a7f3
1 changed files with 4 additions and 4 deletions
|
|
@ -166,6 +166,10 @@ func (t *Trie) TryGetNode(path []byte) ([]byte, int, error) {
|
|||
}
|
||||
|
||||
func (t *Trie) tryGetNode(origNode node, path []byte, pos int) (item []byte, newnode node, resolved int, err error) {
|
||||
// If non-existent path requested, abort
|
||||
if origNode == nil {
|
||||
return nil, nil, 0, nil
|
||||
}
|
||||
// If we reached the requested path, return the current node
|
||||
if pos >= len(path) {
|
||||
// Although we most probably have the original node expanded, encoding
|
||||
|
|
@ -185,10 +189,6 @@ func (t *Trie) tryGetNode(origNode node, path []byte, pos int) (item []byte, new
|
|||
}
|
||||
// Path still needs to be traversed, descend into children
|
||||
switch n := (origNode).(type) {
|
||||
case nil:
|
||||
// Non-existent path requested, abort
|
||||
return nil, nil, 0, nil
|
||||
|
||||
case valueNode:
|
||||
// Path prematurely ended, abort
|
||||
return nil, nil, 0, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue