@@ -2919,9 +2919,10 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
2919
2919
const MempoolAcceptResult result = m_chainman.ProcessTransaction (porphanTx);
2920
2920
const TxValidationState& state = result.m_state ;
2921
2921
const uint256& orphanHash = porphanTx->GetHash ();
2922
+ const uint256& orphan_wtxid = porphanTx->GetWitnessHash ();
2922
2923
2923
2924
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
2924
- LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s\n " , orphanHash.ToString ());
2925
+ LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s (wtxid=%s) \n " , orphanHash. ToString (), orphan_wtxid .ToString ());
2925
2926
RelayTransaction (orphanHash, porphanTx->GetWitnessHash ());
2926
2927
m_orphanage.AddChildrenToWorkSet (*porphanTx);
2927
2928
m_orphanage.EraseTx (orphanHash);
@@ -2931,16 +2932,17 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
2931
2932
return true ;
2932
2933
} else if (state.GetResult () != TxValidationResult::TX_MISSING_INPUTS) {
2933
2934
if (state.IsInvalid ()) {
2934
- LogPrint (BCLog::MEMPOOL, " invalid orphan tx %s from peer=%d. %s\n " ,
2935
+ LogPrint (BCLog::MEMPOOL, " invalid orphan tx %s (wtxid=%s) from peer=%d. %s\n " ,
2935
2936
orphanHash.ToString (),
2937
+ orphan_wtxid.ToString (),
2936
2938
peer.m_id ,
2937
2939
state.ToString ());
2938
2940
// Maybe punish peer that gave us an invalid orphan tx
2939
2941
MaybePunishNodeForTx (peer.m_id , state);
2940
2942
}
2941
2943
// Has inputs but not accepted to mempool
2942
2944
// Probably non-standard or insufficient fee
2943
- LogPrint (BCLog::MEMPOOL, " removed orphan tx %s\n " , orphanHash.ToString ());
2945
+ LogPrint (BCLog::MEMPOOL, " removed orphan tx %s (wtxid=%s) \n " , orphanHash. ToString (), orphan_wtxid .ToString ());
2944
2946
if (state.GetResult () != TxValidationResult::TX_WITNESS_STRIPPED) {
2945
2947
// We can add the wtxid of this transaction to our reject filter.
2946
2948
// Do not add txids of witness transactions or witness-stripped
@@ -4115,9 +4117,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4115
4117
// permission, even if they were already in the mempool, allowing
4116
4118
// the node to function as a gateway for nodes hidden behind it.
4117
4119
if (!m_mempool.exists (GenTxid::Txid (tx.GetHash ()))) {
4118
- LogPrintf (" Not relaying non-mempool transaction %s from forcerelay peer=%d\n " , tx.GetHash ().ToString (), pfrom.GetId ());
4120
+ LogPrintf (" Not relaying non-mempool transaction %s (wtxid=%s) from forcerelay peer=%d\n " ,
4121
+ tx.GetHash ().ToString (), tx.GetWitnessHash ().ToString (), pfrom.GetId ());
4119
4122
} else {
4120
- LogPrintf (" Force relaying tx %s from peer=%d\n " , tx.GetHash ().ToString (), pfrom.GetId ());
4123
+ LogPrintf (" Force relaying tx %s (wtxid=%s) from peer=%d\n " ,
4124
+ tx.GetHash ().ToString (), tx.GetWitnessHash ().ToString (), pfrom.GetId ());
4121
4125
RelayTransaction (tx.GetHash (), tx.GetWitnessHash ());
4122
4126
}
4123
4127
}
@@ -4137,9 +4141,10 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4137
4141
4138
4142
pfrom.m_last_tx_time = GetTime<std::chrono::seconds>();
4139
4143
4140
- LogPrint (BCLog::MEMPOOL, " AcceptToMemoryPool: peer=%d: accepted %s (poolsz %u txn, %u kB)\n " ,
4144
+ LogPrint (BCLog::MEMPOOL, " AcceptToMemoryPool: peer=%d: accepted %s (wtxid=%s) ( poolsz %u txn, %u kB)\n " ,
4141
4145
pfrom.GetId (),
4142
4146
tx.GetHash ().ToString (),
4147
+ tx.GetWitnessHash ().ToString (),
4143
4148
m_mempool.size (), m_mempool.DynamicMemoryUsage () / 1000 );
4144
4149
4145
4150
for (const CTransactionRef& removedTx : result.m_replaced_transactions .value ()) {
@@ -4191,7 +4196,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4191
4196
// DoS prevention: do not allow m_orphanage to grow unbounded (see CVE-2012-3789)
4192
4197
m_orphanage.LimitOrphans (m_opts.max_orphan_txs );
4193
4198
} else {
4194
- LogPrint (BCLog::MEMPOOL, " not keeping orphan with rejected parents %s\n " ,tx.GetHash ().ToString ());
4199
+ LogPrint (BCLog::MEMPOOL, " not keeping orphan with rejected parents %s (wtxid=%s)\n " ,
4200
+ tx.GetHash ().ToString (),
4201
+ tx.GetWitnessHash ().ToString ());
4195
4202
// We will continue to reject this tx since it has rejected
4196
4203
// parents so avoid re-requesting it from other peers.
4197
4204
// Here we add both the txid and the wtxid, as we know that
@@ -4256,7 +4263,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4256
4263
// regardless of false positives.
4257
4264
4258
4265
if (state.IsInvalid ()) {
4259
- LogPrint (BCLog::MEMPOOLREJ, " %s from peer=%d was not accepted: %s\n " , tx.GetHash ().ToString (),
4266
+ LogPrint (BCLog::MEMPOOLREJ, " %s (wtxid=%s) from peer=%d was not accepted: %s\n " ,
4267
+ tx.GetHash ().ToString (),
4268
+ tx.GetWitnessHash ().ToString (),
4260
4269
pfrom.GetId (),
4261
4270
state.ToString ());
4262
4271
MaybePunishNodeForTx (pfrom.GetId (), state);
0 commit comments