Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-introduce nInstantSendKeepLock check for LLMQ-based IS when spork19 is OFF #2829

Merged
merged 1 commit into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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