mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix(trie): intermediate trie node hashes (#11826)
This commit is contained in:
@ -345,9 +345,7 @@ impl RevealedSparseTrie {
|
||||
} else {
|
||||
let value = self.values.get(&path).unwrap();
|
||||
let rlp_node = LeafNodeRef { key, value }.rlp(&mut self.rlp_buf);
|
||||
if let Some(node_hash) = rlp_node.as_hash() {
|
||||
*hash = Some(node_hash);
|
||||
}
|
||||
*hash = rlp_node.as_hash();
|
||||
rlp_node
|
||||
}
|
||||
}
|
||||
@ -360,9 +358,7 @@ impl RevealedSparseTrie {
|
||||
let (_, child) = rlp_node_stack.pop().unwrap();
|
||||
self.rlp_buf.clear();
|
||||
let rlp_node = ExtensionNodeRef::new(key, &child).rlp(&mut self.rlp_buf);
|
||||
if let Some(node_hash) = rlp_node.as_hash() {
|
||||
*hash = Some(node_hash);
|
||||
}
|
||||
*hash = rlp_node.as_hash();
|
||||
rlp_node
|
||||
} else {
|
||||
path_stack.extend([path, child_path]); // need to get rlp node for child first
|
||||
@ -400,9 +396,7 @@ impl RevealedSparseTrie {
|
||||
self.rlp_buf.clear();
|
||||
let rlp_node = BranchNodeRef::new(&branch_value_stack_buf, *state_mask)
|
||||
.rlp(&mut self.rlp_buf);
|
||||
if let Some(node_hash) = rlp_node.as_hash() {
|
||||
*hash = Some(node_hash);
|
||||
}
|
||||
*hash = rlp_node.as_hash();
|
||||
rlp_node
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user