From 7fe1a4a78b774f405039a9bf8314a14c96a74c56 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Thu, 11 Apr 2019 22:11:56 +0200 Subject: [PATCH] Also invoke WriteInstantSendLockMined when IS lock comes after the mined block (#2861) --- src/llmq/quorums_instantsend.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/llmq/quorums_instantsend.cpp b/src/llmq/quorums_instantsend.cpp index 31fcbb7cf5..931332d41c 100644 --- a/src/llmq/quorums_instantsend.cpp +++ b/src/llmq/quorums_instantsend.cpp @@ -718,10 +718,10 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& has CTransactionRef tx; uint256 hashBlock; + const CBlockIndex* pindexMined = nullptr; // we ignore failure here as we must be able to propagate the lock even if we don't have the TX locally if (GetTransaction(islock.txid, tx, Params().GetConsensus(), hashBlock)) { if (!hashBlock.IsNull()) { - const CBlockIndex* pindexMined; { LOCK(cs_main); pindexMined = mapBlockIndex.at(hashBlock); @@ -764,6 +764,9 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& has } db.WriteNewInstantSendLock(hash, islock); + if (pindexMined) { + db.WriteInstantSendLockMined(hash, pindexMined->nHeight); + } } CInv inv(MSG_ISLOCK, hash);