trie: fix minor issue

This commit is contained in:
rjl493456442 2020-04-22 19:10:54 +08:00
parent 14c08d19e3
commit f63c68c245

View file

@ -166,7 +166,7 @@ func proofToPath(rootHash common.Hash, root node, key []byte, proofDb ethdb.KeyV
switch cld := child.(type) {
case nil:
// The trie doesn't contain the key.
return nil, fmt.Errorf("the node is not contained in trie")
return nil, errors.New("the node is not contained in trie")
case *shortNode:
key, parent = keyrest, child // Already resolved
continue
@ -198,7 +198,8 @@ func proofToPath(rootHash common.Hash, root node, key []byte, proofDb ethdb.KeyV
}
// unsetInternal removes all internal node references(hashnode, embedded node).
// It should be called after a trie is constructed with two edge proofs.
// It should be called after a trie is constructed with two edge proofs. Also
// the given boundary keys must be the one used to construct the edge proofs.
//
// It's the key step for range proof. All visited nodes should be marked dirty
// since the node content might be modified. Besides it can happen that some