@@ -352,7 +352,7 @@ void NetInstantSend::ProcessPendingISLocks(std::vector<instantsend::PendingISLoc
352352
353353void NetInstantSend::ProcessInstantSendLock (NodeId from, const uint256& hash, const instantsend::InstantSendLockPtr& islock)
354354{
355- LogPrint (BCLog::INSTANTSEND , " NetSigning ::%s -- txid=%s, islock=%s: processing islock, peer=%d\n " , __func__,
355+ LogPrint (BCLog::INSTANTSEND , " NetInstantSend ::%s -- txid=%s, islock=%s: processing islock, peer=%d\n " , __func__,
356356 islock->txid .ToString (), hash.ToString (), from);
357357
358358 if (m_signer) {
@@ -364,21 +364,13 @@ void NetInstantSend::ProcessInstantSendLock(NodeId from, const uint256& hash, co
364364 auto tx = GetTransaction (nullptr , &m_mempool, islock->txid , Params ().GetConsensus (), hashBlock);
365365 const bool found_transaction{tx != nullptr };
366366 // we ignore failure here as we must be able to propagate the lock even if we don't have the TX locally
367- std::optional< int > minedHeight = GetBlockHeight (m_is_manager, m_chainstate, hashBlock);
367+ const auto minedHeight = GetBlockHeight (m_is_manager, m_chainstate, hashBlock);
368368 if (found_transaction) {
369- if (!minedHeight.has_value ()) {
370- const CBlockIndex* pindexMined = WITH_LOCK (::cs_main,
371- return m_chainstate.m_blockman .LookupBlockIndex (hashBlock));
372- if (pindexMined != nullptr ) {
373- m_is_manager.CacheBlockHeight (pindexMined);
374- minedHeight = pindexMined->nHeight ;
375- }
376- }
377369 // Let's see if the TX that was locked by this islock is already mined in a ChainLocked block. If yes,
378370 // we can simply ignore the islock, as the ChainLock implies locking of all TXs in that chain
379371 if (minedHeight.has_value () && m_chainlocks.HasChainLock (*minedHeight, hashBlock)) {
380372 LogPrint (BCLog::INSTANTSEND , /* Continued */
381- " NetSigning ::%s -- txlock=%s, islock=%s: dropping islock as it already got a "
373+ " NetInstantSend ::%s -- txlock=%s, islock=%s: dropping islock as it already got a "
382374 " ChainLock in block %s, peer=%d\n " ,
383375 __func__, islock->txid .ToString (), hash.ToString (), hashBlock.ToString (), from);
384376 return ;
@@ -388,7 +380,6 @@ void NetInstantSend::ProcessInstantSendLock(NodeId from, const uint256& hash, co
388380 m_is_manager.AddPendingISLock (hash, islock, from);
389381 }
390382
391-
392383 // This will also add children TXs to pendingRetryTxs
393384 m_is_manager.RemoveNonLockedTx (islock->txid , true );
394385 // We don't need the recovered sigs for the inputs anymore. This prevents unnecessary propagation of these sigs.
@@ -398,7 +389,7 @@ void NetInstantSend::ProcessInstantSendLock(NodeId from, const uint256& hash, co
398389
399390 if (found_transaction) {
400391 RemoveMempoolConflictsForLock (hash, *islock);
401- LogPrint (BCLog::INSTANTSEND , " NetSigning ::%s -- notify about lock %s for tx %s\n " , __func__, hash.ToString (),
392+ LogPrint (BCLog::INSTANTSEND , " NetInstantSend ::%s -- notify about lock %s for tx %s\n " , __func__, hash.ToString (),
402393 tx->GetHash ().ToString ());
403394 GetMainSignals ().NotifyTransactionLock (tx, islock);
404395 // bump m_mempool counter to make sure newly locked txes are picked up by getblocktemplate
@@ -588,7 +579,7 @@ void NetInstantSend::ResolveBlockConflicts(const uint256& islockHash, const inst
588579 return ;
589580 }
590581
591- bool isLockedTxKnown = m_is_manager.IsKnownTx (islockHash);
582+ bool hasTxForLock = m_is_manager.HasTxForLock (islockHash);
592583
593584 bool activateBestChain = false ;
594585 for (const auto & p : conflicts) {
@@ -605,7 +596,7 @@ void NetInstantSend::ResolveBlockConflicts(const uint256& islockHash, const inst
605596 // This should not have happened and we are in a state were it's not safe to continue anymore
606597 assert (false );
607598 }
608- if (isLockedTxKnown ) {
599+ if (hasTxForLock ) {
609600 activateBestChain = true ;
610601 } else {
611602 LogPrintf (" NetInstantSend::%s -- resetting block %s\n " , __func__, pindex2->GetBlockHash ().ToString ());
0 commit comments