Skip to content

Commit

Permalink
fix: do not process clsigs while node is still syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored and ogabrielides committed Dec 21, 2023
1 parent 36f3d26 commit 26fee3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/llmq/chainlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ void CChainLocksHandler::ProcessMessage(const CNode& pfrom, const std::string& m

void CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq::CChainLockSig& clsig, const uint256& hash)
{
if (!m_mn_sync.IsBlockchainSynced()) {
// too early to do anything
return;
}

CheckActiveState();

CInv clsigInv(MSG_CLSIG, hash);
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_llmq_chainlocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def run_test(self):
self.log.info("Restart it so that it forgets all the chainlock messages from the past")
self.restart_node(0)
self.connect_nodes(0, 1)
force_finish_mnsync(self.nodes[0])
assert self.nodes[0].getbestblockhash() == good_tip
self.nodes[0].invalidateblock(good_tip)
self.log.info("Now try to reorg the chain")
Expand Down

0 comments on commit 26fee3a

Please sign in to comment.