From 654c1fba8c268cec5baf6f81d78a553c001293bd Mon Sep 17 00:00:00 2001 From: Lev Povolotsky Date: Tue, 23 Jan 2024 13:11:42 -0500 Subject: [PATCH] fix: use concurrent hashmap instead of synchroniztion for recordcache Signed-off-by: Lev Povolotsky --- .../com/hedera/node/app/spi/state/ReadableKVStateBase.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java b/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java index c2463b5bad97..ceba880c8b4c 100644 --- a/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java +++ b/hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/state/ReadableKVStateBase.java @@ -126,8 +126,11 @@ public void reset() { * @param value The value */ protected final void markRead(@NonNull K key, @Nullable V value) { - if (value == null) readCache.put(key, (V) marker); - else readCache.put(key, value); + if (value == null) { + readCache.put(key, (V) marker); + } else { + readCache.put(key, value); + } } /**