mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 13:32:33 +02:00
log: Properly log txs rejected from mempool
This commit is contained in:
parent
5a454d7882
commit
fa9f20b647
@ -1954,7 +1954,10 @@ void static ProcessOrphanTx(CConnman* connman, CTxMemPool& mempool, std::set<uin
|
|||||||
if (MaybePunishNodeForTx(fromPeer, orphan_state)) {
|
if (MaybePunishNodeForTx(fromPeer, orphan_state)) {
|
||||||
setMisbehaving.insert(fromPeer);
|
setMisbehaving.insert(fromPeer);
|
||||||
}
|
}
|
||||||
LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s\n", orphanHash.ToString());
|
LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s from peer=%d. %s\n",
|
||||||
|
orphanHash.ToString(),
|
||||||
|
fromPeer,
|
||||||
|
orphan_state.ToString());
|
||||||
}
|
}
|
||||||
// Has inputs but not accepted to mempool
|
// Has inputs but not accepted to mempool
|
||||||
// Probably non-standard or insufficient fee
|
// Probably non-standard or insufficient fee
|
||||||
@ -2801,8 +2804,7 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
|
|||||||
// peer simply for relaying a tx that our recentRejects has caught,
|
// peer simply for relaying a tx that our recentRejects has caught,
|
||||||
// regardless of false positives.
|
// regardless of false positives.
|
||||||
|
|
||||||
if (state.IsInvalid())
|
if (state.IsInvalid()) {
|
||||||
{
|
|
||||||
LogPrint(BCLog::MEMPOOLREJ, "%s from peer=%d was not accepted: %s\n", tx.GetHash().ToString(),
|
LogPrint(BCLog::MEMPOOLREJ, "%s from peer=%d was not accepted: %s\n", tx.GetHash().ToString(),
|
||||||
pfrom->GetId(),
|
pfrom->GetId(),
|
||||||
state.ToString());
|
state.ToString());
|
||||||
|
@ -569,8 +569,9 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|||||||
CAmount& nConflictingFees = ws.m_conflicting_fees;
|
CAmount& nConflictingFees = ws.m_conflicting_fees;
|
||||||
size_t& nConflictingSize = ws.m_conflicting_size;
|
size_t& nConflictingSize = ws.m_conflicting_size;
|
||||||
|
|
||||||
if (!CheckTransaction(tx, state))
|
if (!CheckTransaction(tx, state)) {
|
||||||
return false; // state filled in by CheckTransaction
|
return false; // state filled in by CheckTransaction
|
||||||
|
}
|
||||||
|
|
||||||
// Coinbase is only valid in a block, not as a loose transaction
|
// Coinbase is only valid in a block, not as a loose transaction
|
||||||
if (tx.IsCoinBase())
|
if (tx.IsCoinBase())
|
||||||
@ -680,7 +681,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|||||||
|
|
||||||
CAmount nFees = 0;
|
CAmount nFees = 0;
|
||||||
if (!Consensus::CheckTxInputs(tx, state, m_view, GetSpendHeight(m_view), nFees)) {
|
if (!Consensus::CheckTxInputs(tx, state, m_view, GetSpendHeight(m_view), nFees)) {
|
||||||
return error("%s: Consensus::CheckTxInputs: %s, %s", __func__, tx.GetHash().ToString(), state.ToString());
|
return false; // state filled in by CheckTxInputs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for non-standard pay-to-script-hash in inputs
|
// Check for non-standard pay-to-script-hash in inputs
|
||||||
|
Loading…
Reference in New Issue
Block a user