From dc70382d73c57c534f8a902516e8ef47316ace54 Mon Sep 17 00:00:00 2001 From: mikera Date: Sun, 1 Dec 2024 18:50:37 +0000 Subject: [PATCH] Fix to ensure peers persist genesis state --- convex-peer/src/main/java/convex/peer/Server.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/convex-peer/src/main/java/convex/peer/Server.java b/convex-peer/src/main/java/convex/peer/Server.java index fa028a449..8da4355d2 100644 --- a/convex-peer/src/main/java/convex/peer/Server.java +++ b/convex-peer/src/main/java/convex/peer/Server.java @@ -631,6 +631,11 @@ public Peer persistPeerData() throws IOException { AMap newRootData = currentRootData.assoc(rootKey, peerData); newRootData=store.setRootData(newRootData).getValue(); + + // ensure specific values are persisted, might be needed for lookup + store.storeTopRef(peer.getGenesisState().getRef(), Ref.PERSISTED, null); + store.storeTopRef(peer.getBelief().getRef(), Ref.PERSISTED, null); + peerData=(AMap) newRootData.get(rootKey); log.debug( "Stored peer data with hash: {}", peerData.getHash().toHexString()); return Peer.fromData(getKeyPair(), peerData);