aboutsummaryrefslogtreecommitdiffstats
path: root/trie/secure_trie.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-15 21:32:14 +0800
committerGitHub <noreply@github.com>2018-01-15 21:32:14 +0800
commit216e584899ed522088419438c9c605a20b5dc9ae (patch)
tree069a00b33295d2a1a2413f2afa52db098dee0863 /trie/secure_trie.go
parent18a7d313386194be39e733ac3043988690f42464 (diff)
downloadgo-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.tar
go-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.tar.gz
go-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.tar.bz2
go-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.tar.lz
go-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.tar.xz
go-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.tar.zst
go-tangerine-216e584899ed522088419438c9c605a20b5dc9ae.zip
Revert "trie: make fullnode children hash calculation concurrently (#15131)" (#15889)
This reverts commit 0f7fbb85d6e939510a3e3bb6493a9a332ddfd8e8.
Diffstat (limited to 'trie/secure_trie.go')
-rw-r--r--trie/secure_trie.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/trie/secure_trie.go b/trie/secure_trie.go
index 1fde45165..20c303f31 100644
--- a/trie/secure_trie.go
+++ b/trie/secure_trie.go
@@ -199,10 +199,10 @@ func (t *SecureTrie) secKey(key []byte) []byte {
// invalid on the next call to hashKey or secKey.
func (t *SecureTrie) hashKey(key []byte) []byte {
h := newHasher(0, 0)
- calculator := h.newCalculator()
- calculator.sha.Write(key)
- buf := calculator.sha.Sum(t.hashKeyBuf[:0])
- h.returnCalculator(calculator)
+ h.sha.Reset()
+ h.sha.Write(key)
+ buf := h.sha.Sum(t.hashKeyBuf[:0])
+ returnHasherToPool(h)
return buf
}