Skip to content

Commit 00e11e6

Browse files
TheBlueMattsdaftuar
andcommitted
[refactor] rename stateDummy -> orphan_state
Co-authored-by: Anthony Towns <[email protected]> Suhas Daftuar <[email protected]>
1 parent f34fa71 commit 00e11e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/net_processing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,10 +1730,10 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se
17301730
// Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan
17311731
// resolution (that is, feeding people an invalid transaction based on LegitTxX in order to get
17321732
// anyone relaying LegitTxX banned)
1733-
CValidationState stateDummy;
1733+
CValidationState orphan_state;
17341734

17351735
if (setMisbehaving.count(fromPeer)) continue;
1736-
if (AcceptToMemoryPool(mempool, stateDummy, porphanTx, &fMissingInputs2, &removed_txn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {
1736+
if (AcceptToMemoryPool(mempool, orphan_state, porphanTx, &fMissingInputs2, &removed_txn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {
17371737
LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanHash.ToString());
17381738
RelayTransaction(orphanTx, connman);
17391739
for (unsigned int i = 0; i < orphanTx.vout.size(); i++) {
@@ -1748,7 +1748,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se
17481748
done = true;
17491749
} else if (!fMissingInputs2) {
17501750
int nDos = 0;
1751-
if (stateDummy.IsInvalid(nDos) && nDos > 0) {
1751+
if (orphan_state.IsInvalid(nDos) && nDos > 0) {
17521752
// Punish peer that gave us an invalid orphan tx
17531753
Misbehaving(fromPeer, nDos);
17541754
setMisbehaving.insert(fromPeer);
@@ -1757,7 +1757,7 @@ void static ProcessOrphanTx(CConnman* connman, std::set<uint256>& orphan_work_se
17571757
// Has inputs but not accepted to mempool
17581758
// Probably non-standard or insufficient fee
17591759
LogPrint(BCLog::MEMPOOL, " removed orphan tx %s\n", orphanHash.ToString());
1760-
if (!orphanTx.HasWitness() && !stateDummy.CorruptionPossible()) {
1760+
if (!orphanTx.HasWitness() && !orphan_state.CorruptionPossible()) {
17611761
// Do not use rejection cache for witness transactions or
17621762
// witness-stripped transactions, as they can have been malleated.
17631763
// See https://github.com/bitcoin/bitcoin/issues/8279 for details.

0 commit comments

Comments
 (0)