@@ -600,14 +600,6 @@ class PeerManagerImpl final : public PeerManager
600
600
void ProcessValidTx (NodeId nodeid, const CTransactionRef& tx, const std::list<CTransactionRef>& replaced_transactions)
601
601
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, cs_main);
602
602
603
- /* * Handle the results of package validation: calls ProcessValidTx and ProcessInvalidTx for
604
- * individual transactions, and caches rejection for the package as a group.
605
- * @param[in] senders Must contain the nodeids of the peers that provided each transaction
606
- * in package, in the same order.
607
- * */
608
- void ProcessPackageResult (const Package& package, const PackageMempoolAcceptResult& package_result, const std::vector<NodeId>& senders)
609
- EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, cs_main);
610
-
611
603
struct PackageToValidate {
612
604
const Package m_txns;
613
605
const std::vector<NodeId> m_senders;
@@ -632,6 +624,12 @@ class PeerManagerImpl final : public PeerManager
632
624
}
633
625
};
634
626
627
+ /* * Handle the results of package validation: calls ProcessValidTx and ProcessInvalidTx for
628
+ * individual transactions, and caches rejection for the package as a group.
629
+ */
630
+ void ProcessPackageResult (const PackageToValidate& package_to_validate, const PackageMempoolAcceptResult& package_result)
631
+ EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, cs_main);
632
+
635
633
/* * Look for a child of this transaction in the orphanage to form a 1-parent-1-child package,
636
634
* skipping any combinations that have already been tried. Return the resulting package along with
637
635
* the senders of its respective transactions, or std::nullopt if no package is found. */
@@ -3251,12 +3249,15 @@ void PeerManagerImpl::ProcessValidTx(NodeId nodeid, const CTransactionRef& tx, c
3251
3249
}
3252
3250
}
3253
3251
3254
- void PeerManagerImpl::ProcessPackageResult (const Package& package , const PackageMempoolAcceptResult& package_result, const std::vector<NodeId>& senders )
3252
+ void PeerManagerImpl::ProcessPackageResult (const PackageToValidate& package_to_validate , const PackageMempoolAcceptResult& package_result)
3255
3253
{
3256
3254
AssertLockNotHeld (m_peer_mutex);
3257
3255
AssertLockHeld (g_msgproc_mutex);
3258
3256
AssertLockHeld (cs_main);
3259
3257
3258
+ const auto & package = package_to_validate.m_txns ;
3259
+ const auto & senders = package_to_validate.m_senders ;
3260
+
3260
3261
if (package_result.m_state .IsInvalid ()) {
3261
3262
m_recent_rejects_reconsiderable.insert (GetPackageHash (package));
3262
3263
}
@@ -4548,7 +4549,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4548
4549
const auto package_result{ProcessNewPackage (m_chainman.ActiveChainstate (), m_mempool, package_to_validate->m_txns , /* test_accept=*/ false , /* client_maxfeerate=*/ std::nullopt)};
4549
4550
LogDebug (BCLog::TXPACKAGES, " package evaluation for %s: %s\n " , package_to_validate->ToString (),
4550
4551
package_result.m_state .IsValid () ? " package accepted" : " package rejected" );
4551
- ProcessPackageResult (package_to_validate-> m_txns , package_result, package_to_validate-> m_senders );
4552
+ ProcessPackageResult (package_to_validate. value () , package_result);
4552
4553
}
4553
4554
}
4554
4555
// If a tx is detected by m_recent_rejects it is ignored. Because we haven't
@@ -4663,7 +4664,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4663
4664
const auto package_result{ProcessNewPackage (m_chainman.ActiveChainstate (), m_mempool, package_to_validate->m_txns , /* test_accept=*/ false , /* client_maxfeerate=*/ std::nullopt)};
4664
4665
LogDebug (BCLog::TXPACKAGES, " package evaluation for %s: %s\n " , package_to_validate->ToString (),
4665
4666
package_result.m_state .IsValid () ? " package accepted" : " package rejected" );
4666
- ProcessPackageResult (package_to_validate-> m_txns , package_result, package_to_validate-> m_senders );
4667
+ ProcessPackageResult (package_to_validate. value () , package_result);
4667
4668
}
4668
4669
}
4669
4670
0 commit comments