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

Commit

Permalink
Merge be618ae into 2b025d3
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerjohn committed Feb 27, 2021
2 parents 2b025d3 + be618ae commit 8f7afd5
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 nil, err
}
smt.SetRoot(newRoot)
return newRoot, err
}

Expand Down

0 comments on commit 8f7afd5

Please sign in to comment.