light: odrTrie tryUpdate should use update (#18107)

TryUpdate does not call t.trie.TryUpdate(key, value) and calls t.trie.TryDelete
instead. The update operation simply deletes the corresponding entry, though
it could retrieve later by odr. However, it adds further network overhead.
This commit is contained in:
Sheldon authored and Felix Lange committed 2018-11-26 13:27:49 +01:00
1 parent f5e6634fd2
commit ca228569e4
1 file changed
+1 -1
+1 -1
View File
@@ -108,7 +108,7 @@ func (t *odrTrie) TryGet(key []byte) ([]byte, error) {
func (t *odrTrie) TryUpdate(key, value []byte) error {
key = crypto.Keccak256(key)
return t.do(key, func() error {
return t.trie.TryDelete(key)
return t.trie.TryUpdate(key, value)
})
}