aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-16 10:40:17 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-05-16 10:37:43 -0400
commitfa9f20b6477a206adf5089398803b45d1a114b6f (patch)
tree2b84d5352975f6a2f7c0310e4e7e86d8c3b1a457 /src
parent5a454d78825f7ff7efaa52eddf8eb1503931b64f (diff)
log: Properly log txs rejected from mempool
Diffstat (limited to 'src')
-rw-r--r--src/net_processing.cpp8
-rw-r--r--src/validation.cpp5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 7e9bb2f27c..fd8f05a46f 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1954,7 +1954,10 @@ void static ProcessOrphanTx(CConnman* connman, CTxMemPool& mempool, std::set<uin
if (MaybePunishNodeForTx(fromPeer, orphan_state)) {
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
// 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,
// 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(),
pfrom->GetId(),
state.ToString());
diff --git a/src/validation.cpp b/src/validation.cpp
index 8a454c8d1b..4a76605bb5 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -569,8 +569,9 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
CAmount& nConflictingFees = ws.m_conflicting_fees;
size_t& nConflictingSize = ws.m_conflicting_size;
- if (!CheckTransaction(tx, state))
+ if (!CheckTransaction(tx, state)) {
return false; // state filled in by CheckTransaction
+ }
// Coinbase is only valid in a block, not as a loose transaction
if (tx.IsCoinBase())
@@ -680,7 +681,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
CAmount nFees = 0;
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