Skip to content

Commit

Permalink
Update wallet transactions when confirmed IS locks are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Apr 5, 2019
1 parent b897505 commit d34ec78
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,11 +828,12 @@ void CInstantSendManager::UpdatedBlockTip(const CBlockIndex* pindexNew)

void CInstantSendManager::HandleFullyConfirmedBlock(const CBlockIndex* pindex)
{
std::unordered_map<uint256, CInstantSendLockPtr> removeISLocks;
{
LOCK(cs);

auto islocks = db.RemoveConfirmedInstantSendLocks(pindex->nHeight);
for (auto& p : islocks) {
removeISLocks = db.RemoveConfirmedInstantSendLocks(pindex->nHeight);
for (auto& p : removeISLocks) {
auto& islockHash = p.first;
auto& islock = p.second;
LogPrint("instantsend", "CInstantSendManager::%s -- txid=%s, islock=%s: removed islock as it got fully confirmed\n", __func__,
Expand All @@ -845,6 +846,10 @@ void CInstantSendManager::HandleFullyConfirmedBlock(const CBlockIndex* pindex)
}
}

for (auto& p : removeISLocks) {
UpdateWalletTransaction(p.second->txid, nullptr);
}

// Retry all not yet locked mempool TXs and TX which where mined after the fully confirmed block
RetryLockTxs(uint256());
}
Expand Down

0 comments on commit d34ec78

Please sign in to comment.