Re-introduce nInstantSendKeepLock check for LLMQ-based IS when spork19 is OFF (#2829)
This commit is contained in:
parent
92c1cdcb81
commit
208406df71
@ -60,6 +60,7 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con
|
||||
if (fLiteMode)
|
||||
return;
|
||||
|
||||
llmq::quorumInstantSendManager->UpdatedBlockTip(pindexNew);
|
||||
llmq::chainLocksHandler->UpdatedBlockTip(pindexNew, pindexFork);
|
||||
|
||||
CPrivateSend::UpdatedBlockTip(pindexNew);
|
||||
|
@ -798,6 +798,23 @@ void CInstantSendManager::NotifyChainLock(const CBlockIndex* pindexChainLock)
|
||||
RetryLockTxs(uint256());
|
||||
}
|
||||
|
||||
void CInstantSendManager::UpdatedBlockTip(const CBlockIndex* pindexNew)
|
||||
{
|
||||
if (sporkManager.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED)) {
|
||||
// Nothing to do here. We should keep all islocks and let chainlocks handle them.
|
||||
return;
|
||||
}
|
||||
|
||||
int nChainLockMinHeight = pindexNew->nHeight - Params().GetConsensus().nInstantSendKeepLock;
|
||||
const CBlockIndex* pindex = pindexNew->GetAncestor(nChainLockMinHeight);
|
||||
|
||||
if (pindex) {
|
||||
// Pretend it was chainlocked at nChainLockMinHeight.
|
||||
// This effectively drops all islocks below nChainLockMinHeight.
|
||||
NotifyChainLock(pindex);
|
||||
}
|
||||
}
|
||||
|
||||
void CInstantSendManager::RemoveFinalISLock(const uint256& hash, const CInstantSendLockPtr& islock)
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
@ -122,6 +122,7 @@ public:
|
||||
|
||||
void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock);
|
||||
void NotifyChainLock(const CBlockIndex* pindexChainLock);
|
||||
void UpdatedBlockTip(const CBlockIndex* pindexNew);
|
||||
void RemoveFinalISLock(const uint256& hash, const CInstantSendLockPtr& islock);
|
||||
|
||||
void RemoveMempoolConflictsForLock(const uint256& hash, const CInstantSendLock& islock);
|
||||
|
Loading…
Reference in New Issue
Block a user