mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
trie/bintrie: use EmptyRef for zero-hash children in deserialization
This commit is contained in:
parent
cff5fca22f
commit
d5969de518
1 changed files with 7 additions and 2 deletions
|
|
@ -156,8 +156,13 @@ func (s *NodeStore) deserializeNode(serialized []byte, depth int, hn common.Hash
|
|||
copy(leftHash[:], serialized[NodeTypeBytes:NodeTypeBytes+HashSize])
|
||||
copy(rightHash[:], serialized[NodeTypeBytes+HashSize:])
|
||||
|
||||
leftRef := s.newHashedRef(leftHash)
|
||||
rightRef := s.newHashedRef(rightHash)
|
||||
var leftRef, rightRef NodeRef
|
||||
if leftHash != (common.Hash{}) {
|
||||
leftRef = s.newHashedRef(leftHash)
|
||||
}
|
||||
if rightHash != (common.Hash{}) {
|
||||
rightRef = s.newHashedRef(rightHash)
|
||||
}
|
||||
|
||||
ref := s.newInternalRef(depth)
|
||||
node := s.getInternal(ref.Index())
|
||||
|
|
|
|||
Loading…
Reference in a new issue