Skip to content

Commit

Permalink
fix: reset sync state when closing in AbstractQuorumState
Browse files Browse the repository at this point in the history
Signed-off-by: HashEngineering <[email protected]>
  • Loading branch information
HashEngineering committed Dec 19, 2023
1 parent 3497397 commit 3b61c68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -856,4 +856,10 @@ Sha256Hash getHashModifier(LLMQParameters llmqParams, StoredBlock quorumBaseBloc
}
return LLMQUtils.buildLLMQBlockHash(llmqParams.getType(), quorumBaseBlock.getHeader().getHash());
}

public void close() {
// reset the state of any sync operation
initChainTipSyncComplete = false;
waitingForMNListDiff = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ public void close() {
quorumState.removeEventListeners(blockChain.getBlockChain(), peerGroup);
quorumRotationState.removeEventListeners(blockChain.getBlockChain(), peerGroup);
// reset state of chain sync
quorumState.initChainTipSyncComplete = false;
quorumRotationState.initChainTipSyncComplete = false;
quorumState.close();
quorumRotationState.close();

try {
threadPool.shutdown();
Expand Down

0 comments on commit 3b61c68

Please sign in to comment.