Skip to content

Commit

Permalink
fix concurrent modification exception for bonsai trie(hyperledger#2152)
Browse files Browse the repository at this point in the history
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
  • Loading branch information
matkt authored Apr 26, 2021
1 parent 089bfab commit aa399b3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

import org.apache.tuweni.bytes.Bytes;
Expand All @@ -53,7 +54,8 @@ public class BonsaiWorldStateUpdater extends AbstractWorldUpdater<BonsaiWorldVie
// storage sub mapped by _hashed_ key. This is because in self_destruct calls we need to
// enumerate the old storage and delete it. Those are trie stored by hashed key by spec and the
// alternative was to keep a giant pre-image cache of the entire trie.
private final Map<Address, Map<Hash, BonsaiValue<UInt256>>> storageToUpdate = new HashMap<>();
private final Map<Address, Map<Hash, BonsaiValue<UInt256>>> storageToUpdate =
new ConcurrentHashMap<>();

BonsaiWorldStateUpdater(final BonsaiWorldView world) {
super(world);
Expand Down

0 comments on commit aa399b3

Please sign in to comment.