Skip to content

Commit 4fce726

Browse files
committed
ProcessOrphanTx: Remove aliases
1 parent e07c5d9 commit 4fce726

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/net_processing.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,14 +2057,12 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
20572057
if (orphan_it == mapOrphanTransactions.end()) continue;
20582058

20592059
const CTransactionRef porphanTx = orphan_it->second.tx;
2060-
const CTransaction& orphanTx = *porphanTx;
2061-
NodeId fromPeer = orphan_it->second.fromPeer;
20622060
TxValidationState state;
20632061

20642062
if (AcceptToMemoryPool(m_mempool, state, porphanTx, &removed_txn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {
20652063
LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanHash.ToString());
20662064
RelayTransaction(orphanHash, porphanTx->GetWitnessHash(), m_connman);
2067-
for (unsigned int i = 0; i < orphanTx.vout.size(); i++) {
2065+
for (unsigned int i = 0; i < porphanTx->vout.size(); i++) {
20682066
auto it_by_prev = mapOrphanTransactionsByPrev.find(COutPoint(orphanHash, i));
20692067
if (it_by_prev != mapOrphanTransactionsByPrev.end()) {
20702068
for (const auto& elem : it_by_prev->second) {
@@ -2078,10 +2076,10 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
20782076
if (state.IsInvalid()) {
20792077
LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s from peer=%d. %s\n",
20802078
orphanHash.ToString(),
2081-
fromPeer,
2079+
orphan_it->second.fromPeer,
20822080
state.ToString());
20832081
// Maybe punish peer that gave us an invalid orphan tx
2084-
MaybePunishNodeForTx(fromPeer, state);
2082+
MaybePunishNodeForTx(orphan_it->second.fromPeer, state);
20852083
}
20862084
// Has inputs but not accepted to mempool
20872085
// Probably non-standard or insufficient fee
@@ -2101,7 +2099,7 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
21012099
// for concerns around weakening security of unupgraded nodes
21022100
// if we start doing this too early.
21032101
assert(recentRejects);
2104-
recentRejects->insert(orphanTx.GetWitnessHash());
2102+
recentRejects->insert(porphanTx->GetWitnessHash());
21052103
// If the transaction failed for TX_INPUTS_NOT_STANDARD,
21062104
// then we know that the witness was irrelevant to the policy
21072105
// failure, since this check depends only on the txid
@@ -2110,10 +2108,10 @@ void PeerManager::ProcessOrphanTx(std::set<uint256>& orphan_work_set, std::list<
21102108
// processing of this transaction in the event that child
21112109
// transactions are later received (resulting in
21122110
// parent-fetching by txid via the orphan-handling logic).
2113-
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && orphanTx.GetWitnessHash() != orphanTx.GetHash()) {
2111+
if (state.GetResult() == TxValidationResult::TX_INPUTS_NOT_STANDARD && porphanTx->GetWitnessHash() != porphanTx->GetHash()) {
21142112
// We only add the txid if it differs from the wtxid, to
21152113
// avoid wasting entries in the rolling bloom filter.
2116-
recentRejects->insert(orphanTx.GetHash());
2114+
recentRejects->insert(porphanTx->GetHash());
21172115
}
21182116
}
21192117
EraseOrphanTx(orphanHash);

0 commit comments

Comments
 (0)