Skip to content

Commit

Permalink
Re-introduce nInstantSendKeepLock check for LLMQ-based IS when spork1…
Browse files Browse the repository at this point in the history
…9 is OFF (#2829)
  • Loading branch information
UdjinM6 authored and codablock committed Apr 5, 2019
1 parent 92c1cdc commit 208406d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dsnotificationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 17 additions & 0 deletions src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/llmq/quorums_instantsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class CInstantSendManager : public CRecoveredSigsListener

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);
Expand Down

0 comments on commit 208406d

Please sign in to comment.