Skip to content

Commit 4763b51

Browse files
committed
ProcessOrphanTx: remove useless setMisbehaving set
This starts empty, and is only added to if we're about to exit the function (so we never read from it).
1 parent 55c79a9 commit 4763b51

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,6 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
20482048
{
20492049
AssertLockHeld(cs_main);
20502050
AssertLockHeld(g_cs_orphans);
2051-
std::set<NodeId> setMisbehaving;
20522051

20532052
while (!orphan_work_set.empty()) {
20542053
const uint256 orphanHash = *orphan_work_set.begin();
@@ -2065,7 +2064,6 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
20652064
// that relayed the previous transaction).
20662065
TxValidationState orphan_state;
20672066

2068-
if (setMisbehaving.count(fromPeer)) continue;
20692067
if (AcceptToMemoryPool(m_mempool, orphan_state, porphanTx, &removed_txn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {
20702068
LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanHash.ToString());
20712069
RelayTransaction(orphanHash, porphanTx->GetWitnessHash(), m_connman);
@@ -2081,14 +2079,12 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
20812079
break;
20822080
} else if (orphan_state.GetResult() != TxValidationResult::TX_MISSING_INPUTS) {
20832081
if (orphan_state.IsInvalid()) {
2084-
// Punish peer that gave us an invalid orphan tx
2085-
if (MaybePunishNodeForTx(fromPeer, orphan_state)) {
2086-
setMisbehaving.insert(fromPeer);
2087-
}
20882082
LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s from peer=%d. %s\n",
20892083
orphanHash.ToString(),
20902084
fromPeer,
20912085
orphan_state.ToString());
2086+
// Maybe punish peer that gave us an invalid orphan tx
2087+
MaybePunishNodeForTx(fromPeer, orphan_state);
20922088
}
20932089
// Has inputs but not accepted to mempool
20942090
// Probably non-standard or insufficient fee

0 commit comments

Comments
 (0)