Skip to content

Commit

Permalink
utils: update comment in node.go's Hash()
Browse files Browse the repository at this point in the history
This reflects the lazy hash calculation and the implications of this.
  • Loading branch information
codablock committed Jan 10, 2024
1 parent f7c30f5 commit 0eddb86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/merkletrie/filesystem/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func NewRootNode(
// difftree algorithm will detect changes in the contents of files and also in
// their mode.
//
// Please note that the hash is calculated on first invocation of Hash(),
// meaning that it will not update when the underlying file changes
// between invocations.
//
// The hash of a directory is always a 24-bytes slice of zero values
func (n *node) Hash() []byte {
if n.hash == nil {
Expand Down

0 comments on commit 0eddb86

Please sign in to comment.