Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Merge c5b77c8 into 22852aa
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerjohn committed Feb 20, 2021
2 parents 22852aa + c5b77c8 commit c10fb3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions smt.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ func (smt *SparseMerkleTree) HasForRoot(key, root []byte) (bool, error) {
// Update sets a new value for a key in the tree, and sets and returns the new root of the tree.
func (smt *SparseMerkleTree) Update(key []byte, value []byte) ([]byte, error) {
newRoot, err := smt.UpdateForRoot(key, value, smt.Root())
if err == nil {
smt.SetRoot(newRoot)
if err != nil {
return newRoot, err
}
smt.SetRoot(newRoot)
return newRoot, err
}

Expand Down

0 comments on commit c10fb3c

Please sign in to comment.