Also invoke WriteInstantSendLockMined when IS lock comes after the mined block (#2861)

This commit is contained in:
Alexander Block 2019-04-11 22:11:56 +02:00 committed by UdjinM6
parent f32f9523b9
commit 7fe1a4a78b

View File

@ -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);