Add test checking that ProcessOrphanTx reconsiders at most one orphan per ProcessMessages(). This test prevents regression of CVE-2024-52914 which currently no existing test checks.
The test kills 2 mutants found with https://github.com/ViniciusCestarii/mutant-harness:
<details> <summary>1. Remove <code>return true</code> after an orphan is accepted</summary>
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3494,7 +3494,6 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
LogDebug(BCLog::TXPACKAGES, " accepted orphan tx %s (wtxid=%s)\n", orphanHash.ToString(), orphan_wtxid.ToString());
ProcessValidTx(peer.m_id, porphanTx, result.m_replaced_transactions);
- return true;
} else if (state.GetResult() != TxValidationResult::TX_MISSING_INPUTS) {
</details>
<details> <summary>2. Remove <code>return true</code> after an orphan is rejected for a reason other than <code>TX_MISSING_INPUTS</code></summary>
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3508,7 +3508,6 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
state.GetResult() != TxValidationResult::TX_RESULT_UNSET)) {
ProcessInvalidTx(peer.m_id, porphanTx, state, /*first_time_failure=*/false);
}
- return true;
}
}
</details>