mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
eth/protocols/snap: save nodes on right boundary in hash mode
This commit is contained in:
parent
7ed52c949e
commit
90b83aaec1
1 changed files with 2 additions and 1 deletions
|
|
@ -280,8 +280,9 @@ func (t *hashTrie) update(key, value []byte) error {
|
||||||
|
|
||||||
// commit implements genTrie interface, committing the nodes on right boundary.
|
// commit implements genTrie interface, committing the nodes on right boundary.
|
||||||
func (t *hashTrie) commit(complete bool) common.Hash {
|
func (t *hashTrie) commit(complete bool) common.Hash {
|
||||||
|
hash := t.tr.Hash() // flush the nodes on right boundary
|
||||||
if !complete {
|
if !complete {
|
||||||
return common.Hash{} // the hash is meaningless for incomplete commit
|
return common.Hash{} // the hash is meaningless for incomplete commit
|
||||||
}
|
}
|
||||||
return t.tr.Hash() // return hash only if it's claimed as complete
|
return hash // return hash only if it's claimed as complete
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue