From 68be45e5f89a5bde33376a8e103c133392f18516 Mon Sep 17 00:00:00 2001 From: Ɓukasz Kurowski Date: Fri, 16 Nov 2018 10:50:48 +0100 Subject: trie: return hasher to pool (#18116) * trie: return hasher to pool * trie: minor code formatting fix --- trie/iterator.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'trie/iterator.go') diff --git a/trie/iterator.go b/trie/iterator.go index 00b890eb8..77f168166 100644 --- a/trie/iterator.go +++ b/trie/iterator.go @@ -181,6 +181,8 @@ func (it *nodeIterator) LeafProof() [][]byte { if len(it.stack) > 0 { if _, ok := it.stack[len(it.stack)-1].node.(valueNode); ok { hasher := newHasher(0, 0, nil) + defer returnHasherToPool(hasher) + proofs := make([][]byte, 0, len(it.stack)) for i, item := range it.stack[:len(it.stack)-1] { -- cgit