Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return hash for empty trees in Hash() and SaveVersion() #304

Merged
merged 2 commits into from
Aug 8, 2020

Conversation

erikgrinaker
Copy link
Contributor

Related to tendermint/tendermint#5192, for RFC-6962 conformance.

@erikgrinaker erikgrinaker added the S:automerge Automatic merge and/or update Pull requests label Aug 7, 2020
@erikgrinaker erikgrinaker self-assigned this Aug 7, 2020
func (node *Node) hashWithCount() ([]byte, int64) {
if node == nil {
return sha256.New().Sum(nil), 0
Copy link
Contributor

@alexanderbez alexanderbez Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be nil or a byte representation of an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the hash input? nil and []byte{} are equivalent.

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:automerge Automatic merge and/or update Pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants