Skip to content

Commit

Permalink
chore: export warpsyncstate
Browse files Browse the repository at this point in the history
  • Loading branch information
ablax committed Sep 10, 2024
1 parent 62de89e commit bf6fc62
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class GrandpaEngine {
protected ConnectionManager connectionManager;
private static NeighbourMessageBuilder neighbourMessageBuilder = new NeighbourMessageBuilder();
private static BlockAnnounceHandshakeBuilder handshakeBuilder = new BlockAnnounceHandshakeBuilder();
private static WarpSyncState warpSyncState = AppBean.getBean(WarpSyncState.class);

public GrandpaEngine() {
connectionManager = ConnectionManager.getInstance();
Expand Down Expand Up @@ -69,13 +70,13 @@ private static void handleNeighbourMessage(byte[] message, String peerId) {
ScaleCodecReader reader = new ScaleCodecReader(message);
NeighbourMessage neighbourMessage = reader.read(NeighbourMessageScaleReader.getInstance());
log.log(Level.INFO, "Received neighbour message from Peer " + peerId + "\n" + neighbourMessage);
new Thread(() -> AppBean.getBean(WarpSyncState.class).syncNeighbourMessage(neighbourMessage, peerId)).start();
new Thread(() -> warpSyncState.syncNeighbourMessage(neighbourMessage, peerId)).start();
}

private static void handleCommitMessage(byte[] message, String peerId) {
ScaleCodecReader reader = new ScaleCodecReader(message);
CommitMessage commitMessage = reader.read(CommitMessageScaleReader.getInstance());
AppBean.getBean(WarpSyncState.class).syncCommit(commitMessage, peerId);
warpSyncState.syncCommit(commitMessage, peerId);
}

/**
Expand Down

0 comments on commit bf6fc62

Please sign in to comment.