Skip to content

Commit 550ae8a

Browse files
committed
Move orphan tx handling to a separate log class
1 parent b1ba550 commit 550ae8a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer)
566566
unsigned int sz = tx.GetSerializeSize(SER_NETWORK, CTransaction::CURRENT_VERSION);
567567
if (sz > 5000)
568568
{
569-
LogPrint("mempool", "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
569+
LogPrint("orphan", "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
570570
return false;
571571
}
572572

@@ -575,7 +575,7 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer)
575575
BOOST_FOREACH(const CTxIn& txin, tx.vin)
576576
mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash);
577577

578-
LogPrint("mempool", "stored orphan tx %s (mapsz %u prevsz %u)\n", hash.ToString(),
578+
LogPrint("orphan", "stored orphan tx %s (mapsz %u prevsz %u)\n", hash.ToString(),
579579
mapOrphanTransactions.size(), mapOrphanTransactionsByPrev.size());
580580
return true;
581581
}
@@ -610,7 +610,7 @@ void EraseOrphansFor(NodeId peer)
610610
++nErased;
611611
}
612612
}
613-
if (nErased > 0) LogPrint("mempool", "Erased %d orphan tx from peer %d\n", nErased, peer);
613+
if (nErased > 0) LogPrint("orphan", "Erased %d orphan tx from peer %d\n", nErased, peer);
614614
}
615615

616616

@@ -4273,7 +4273,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
42734273
continue;
42744274
if (AcceptToMemoryPool(mempool, stateDummy, orphanTx, true, &fMissingInputs2))
42754275
{
4276-
LogPrint("mempool", " accepted orphan tx %s\n", orphanHash.ToString());
4276+
LogPrint("orphan", " accepted orphan tx %s\n", orphanHash.ToString());
42774277
RelayTransaction(orphanTx);
42784278
vWorkQueue.push_back(orphanHash);
42794279
vEraseQueue.push_back(orphanHash);
@@ -4286,11 +4286,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
42864286
// Punish peer that gave us an invalid orphan tx
42874287
Misbehaving(fromPeer, nDos);
42884288
setMisbehaving.insert(fromPeer);
4289-
LogPrint("mempool", " invalid orphan tx %s\n", orphanHash.ToString());
4289+
LogPrint("orphan", " invalid orphan tx %s\n", orphanHash.ToString());
42904290
}
42914291
// Has inputs but not accepted to mempool
42924292
// Probably non-standard or insufficient fee/priority
4293-
LogPrint("mempool", " removed orphan tx %s\n", orphanHash.ToString());
4293+
LogPrint("orphan", " removed orphan tx %s\n", orphanHash.ToString());
42944294
vEraseQueue.push_back(orphanHash);
42954295
recentRejects.insert(orphanHash);
42964296
}
@@ -4309,7 +4309,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
43094309
unsigned int nMaxOrphanTx = (unsigned int)std::max((int64_t)0, GetArg("-maxorphantx", DEFAULT_MAX_ORPHAN_TRANSACTIONS));
43104310
unsigned int nEvicted = LimitOrphanTxSize(nMaxOrphanTx);
43114311
if (nEvicted > 0)
4312-
LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted);
4312+
LogPrint("orphan", "mapOrphan overflow, removed %u tx\n", nEvicted);
43134313
} else {
43144314
// AcceptToMemoryPool() returned false, possibly because the tx is
43154315
// already in the mempool; if the tx isn't in the mempool that

0 commit comments

Comments
 (0)