aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-06-25 15:39:32 -0400
committerJohn Newbery <john@johnnewbery.com>2020-09-07 20:07:43 +0100
commit4763b51bca86fb9e49175619a47cdbef34feaf99 (patch)
tree1d28e8e7f0aebcdf9fe8c9e834ce1796129c385a /src/net_processing.cpp
parent55c79a9cefb6c83cdebbf6c538c471607695b457 (diff)
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).
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 45cb29065e..40783e210c 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2048,7 +2048,6 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
{
AssertLockHeld(cs_main);
AssertLockHeld(g_cs_orphans);
- std::set<NodeId> setMisbehaving;
while (!orphan_work_set.empty()) {
const uint256 orphanHash = *orphan_work_set.begin();
@@ -2065,7 +2064,6 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
// that relayed the previous transaction).
TxValidationState orphan_state;
- if (setMisbehaving.count(fromPeer)) continue;
if (AcceptToMemoryPool(m_mempool, orphan_state, porphanTx, &removed_txn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {
LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanHash.ToString());
RelayTransaction(orphanHash, porphanTx->GetWitnessHash(), m_connman);
@@ -2081,14 +2079,12 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
break;
} else if (orphan_state.GetResult() != TxValidationResult::TX_MISSING_INPUTS) {
if (orphan_state.IsInvalid()) {
- // Punish peer that gave us an invalid orphan tx
- if (MaybePunishNodeForTx(fromPeer, orphan_state)) {
- setMisbehaving.insert(fromPeer);
- }
LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s from peer=%d. %s\n",
orphanHash.ToString(),
fromPeer,
orphan_state.ToString());
+ // Maybe punish peer that gave us an invalid orphan tx
+ MaybePunishNodeForTx(fromPeer, orphan_state);
}
// Has inputs but not accepted to mempool
// Probably non-standard or insufficient fee