diff --git a/src/llmq/instantsend.cpp b/src/llmq/instantsend.cpp index 713e874be5..bf76757fb2 100644 --- a/src/llmq/instantsend.cpp +++ b/src/llmq/instantsend.cpp @@ -1124,13 +1124,14 @@ void CInstantSendManager::BlockConnected(const std::shared_ptr& pb } if (m_mn_sync.IsBlockchainSynced()) { + const bool has_chainlock = clhandler.HasChainLock(pindex->nHeight, pindex->GetBlockHash()); for (const auto& tx : pblock->vtx) { if (tx->IsCoinBase() || tx->vin.empty()) { // coinbase and TXs with no inputs can't be locked continue; } - if (!IsLocked(tx->GetHash()) && !clhandler.HasChainLock(pindex->nHeight, pindex->GetBlockHash())) { + if (!IsLocked(tx->GetHash()) && !has_chainlock) { ProcessTx(*tx, true, Params().GetConsensus()); // TX is not locked, so make sure it is tracked AddNonLockedTx(tx, pindex); diff --git a/src/validation.cpp b/src/validation.cpp index 58ef87b637..fda0a2b1f7 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2186,11 +2186,12 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, if (m_isman->RejectConflictingBlocks()) { // Require other nodes to comply, send them some data in case they are missing it. + const bool has_chainlock = m_clhandler->HasChainLock(pindex->nHeight, pindex->GetBlockHash()); for (const auto& tx : block.vtx) { // skip txes that have no inputs if (tx->vin.empty()) continue; while (llmq::CInstantSendLockPtr conflictLock = m_isman->GetConflictingLock(*tx)) { - if (m_clhandler->HasChainLock(pindex->nHeight, pindex->GetBlockHash())) { + if (has_chainlock) { LogPrint(BCLog::ALL, "ConnectBlock(DASH): chain-locked transaction %s overrides islock %s\n", tx->GetHash().ToString(), ::SerializeHash(*conflictLock).ToString()); m_isman->RemoveConflictingLock(::SerializeHash(*conflictLock), *conflictLock);