trie: no getting hasher in fullNode.EncodeRLP

This commit is contained in:
qianbin 2024-01-19 21:10:36 +08:00
parent f59bd61282
commit 3f68009d62

View file

@ -54,10 +54,7 @@ var nilValueNode = valueNode(nil)
// EncodeRLP encodes a full node into the consensus RLP format. // EncodeRLP encodes a full node into the consensus RLP format.
func (n *fullNode) EncodeRLP(w io.Writer) error { func (n *fullNode) EncodeRLP(w io.Writer) error {
h := newHasher(false) _, err := w.Write(n.encode(nil))
defer returnHasherToPool(h)
h.tmp = n.encode(h.tmp[:0])
_, err := w.Write(h.tmp)
return err return err
} }