@@ -406,7 +406,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error
406
406
}
407
407
408
408
// hasRightElement returns the indicator whether there exists more elements
409
- // in the right side of the given path. The given path can point to an existent
409
+ // on the right side of the given path. The given path can point to an existent
410
410
// key or a non-existent one. This function has the assumption that the whole
411
411
// path should already be resolved.
412
412
func hasRightElement (node node , key []byte ) bool {
@@ -505,7 +505,7 @@ func VerifyRangeProof(rootHash common.Hash, firstKey []byte, lastKey []byte, key
505
505
if val != nil || hasRightElement (root , firstKey ) {
506
506
return false , errors .New ("more entries available" )
507
507
}
508
- return hasRightElement ( root , firstKey ) , nil
508
+ return false , nil
509
509
}
510
510
// Special case, there is only one element and two edge keys are same.
511
511
// In this case, we can't construct two edge paths. So handle it here.
@@ -563,7 +563,7 @@ func VerifyRangeProof(rootHash common.Hash, firstKey []byte, lastKey []byte, key
563
563
if tr .Hash () != rootHash {
564
564
return false , fmt .Errorf ("invalid proof, want hash %x, got %x" , rootHash , tr .Hash ())
565
565
}
566
- return hasRightElement (root , keys [len (keys )- 1 ]), nil
566
+ return hasRightElement (tr . root , keys [len (keys )- 1 ]), nil
567
567
}
568
568
569
569
// get returns the child of the given node. Return nil if the
0 commit comments