Skip to content

Commit c8e67b9

Browse files
committed
[refactor] move ProcessInvalidTx and ProcessValidTx definitions down
ProcessInvalidTx will return a PackageToValidate, so it needs to be defined afterward.
1 parent 3a41926 commit c8e67b9

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/net_processing.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -564,20 +564,6 @@ class PeerManagerImpl final : public PeerManager
564564
*/
565565
bool MaybeDiscourageAndDisconnect(CNode& pnode, Peer& peer);
566566

567-
/** Handle a transaction whose result was not MempoolAcceptResult::ResultType::VALID.
568-
* @param[in] first_time_failure Whether this tx should be added to vExtraTxnForCompact.
569-
* Set to false if the tx has already been rejected before,
570-
* e.g. is an orphan, to avoid adding duplicate entries.
571-
* Updates m_txrequest, m_lazy_recent_rejects, m_lazy_recent_rejects_reconsiderable, m_orphanage, and vExtraTxnForCompact. */
572-
void ProcessInvalidTx(NodeId nodeid, const CTransactionRef& tx, const TxValidationState& result,
573-
bool first_time_failure)
574-
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, m_tx_download_mutex);
575-
576-
/** Handle a transaction whose result was MempoolAcceptResult::ResultType::VALID.
577-
* Updates m_txrequest, m_orphanage, and vExtraTxnForCompact. Also queues the tx for relay. */
578-
void ProcessValidTx(NodeId nodeid, const CTransactionRef& tx, const std::list<CTransactionRef>& replaced_transactions)
579-
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, m_tx_download_mutex);
580-
581567
struct PackageToValidate {
582568
const Package m_txns;
583569
const std::vector<NodeId> m_senders;
@@ -602,6 +588,20 @@ class PeerManagerImpl final : public PeerManager
602588
}
603589
};
604590

591+
/** Handle a transaction whose result was not MempoolAcceptResult::ResultType::VALID.
592+
* @param[in] first_time_failure Whether this tx should be added to vExtraTxnForCompact.
593+
* Set to false if the tx has already been rejected before,
594+
* e.g. is an orphan, to avoid adding duplicate entries.
595+
* Updates m_txrequest, m_lazy_recent_rejects, m_lazy_recent_rejects_reconsiderable, m_orphanage, and vExtraTxnForCompact. */
596+
void ProcessInvalidTx(NodeId nodeid, const CTransactionRef& tx, const TxValidationState& result,
597+
bool first_time_failure)
598+
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, m_tx_download_mutex);
599+
600+
/** Handle a transaction whose result was MempoolAcceptResult::ResultType::VALID.
601+
* Updates m_txrequest, m_orphanage, and vExtraTxnForCompact. Also queues the tx for relay. */
602+
void ProcessValidTx(NodeId nodeid, const CTransactionRef& tx, const std::list<CTransactionRef>& replaced_transactions)
603+
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex, m_tx_download_mutex);
604+
605605
/** Handle the results of package validation: calls ProcessValidTx and ProcessInvalidTx for
606606
* individual transactions, and caches rejection for the package as a group.
607607
*/

0 commit comments

Comments
 (0)