Skip to content

Commit 7b5f2b6

Browse files
authored
fix: 13610: Backport the fix for 13584 to 0.50 (#13611)
Signed-off-by: Artem Ananev <[email protected]>
1 parent adfd95d commit 7b5f2b6

File tree

1 file changed

+5
-3
lines changed
  • platform-sdk/swirlds-virtualmap/src/main/java/com/swirlds/virtualmap/internal/merkle

1 file changed

+5
-3
lines changed

platform-sdk/swirlds-virtualmap/src/main/java/com/swirlds/virtualmap/internal/merkle/VirtualRootNode.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -1316,13 +1316,15 @@ public void onNodeHashed(final long path, final Hash hash) {
13161316
virtualHash = (rootHash != null) ? rootHash : hasher.emptyRootHash();
13171317
}
13181318

1319+
// There are no remaining changes to be made to the cache, so we can seal it.
1320+
cache.seal();
1321+
1322+
// Make sure the copy is marked as hashed after the cache is sealed, otherwise the chances
1323+
// are an attempt to merge the cache will fail because the cache hasn't been sealed yet
13191324
setHashPrivate(virtualHash);
13201325

13211326
final long end = System.currentTimeMillis();
13221327
statistics.recordHash(end - start);
1323-
1324-
// There are no remaining changes to be made to the cache, so we can seal it.
1325-
cache.seal();
13261328
}
13271329

13281330
/*

0 commit comments

Comments
 (0)