@@ -2919,9 +2919,10 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
29192919 const MempoolAcceptResult result = m_chainman.ProcessTransaction (porphanTx);
29202920 const TxValidationState& state = result.m_state ;
29212921 const uint256& orphanHash = porphanTx->GetHash ();
2922+ const uint256& orphan_wtxid = porphanTx->GetWitnessHash ();
29222923
29232924 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 ());
29252926 RelayTransaction (orphanHash, porphanTx->GetWitnessHash ());
29262927 m_orphanage.AddChildrenToWorkSet (*porphanTx);
29272928 m_orphanage.EraseTx (orphanHash);
@@ -2931,16 +2932,17 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)
29312932 return true ;
29322933 } else if (state.GetResult () != TxValidationResult::TX_MISSING_INPUTS) {
29332934 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 " ,
29352936 orphanHash.ToString (),
2937+ orphan_wtxid.ToString (),
29362938 peer.m_id ,
29372939 state.ToString ());
29382940 // Maybe punish peer that gave us an invalid orphan tx
29392941 MaybePunishNodeForTx (peer.m_id , state);
29402942 }
29412943 // Has inputs but not accepted to mempool
29422944 // 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 ());
29442946 if (state.GetResult () != TxValidationResult::TX_WITNESS_STRIPPED) {
29452947 // We can add the wtxid of this transaction to our reject filter.
29462948 // Do not add txids of witness transactions or witness-stripped
@@ -4115,9 +4117,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41154117 // permission, even if they were already in the mempool, allowing
41164118 // the node to function as a gateway for nodes hidden behind it.
41174119 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 ());
41194122 } 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 ());
41214125 RelayTransaction (tx.GetHash (), tx.GetWitnessHash ());
41224126 }
41234127 }
@@ -4137,9 +4141,10 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41374141
41384142 pfrom.m_last_tx_time = GetTime<std::chrono::seconds>();
41394143
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 " ,
41414145 pfrom.GetId (),
41424146 tx.GetHash ().ToString (),
4147+ tx.GetWitnessHash ().ToString (),
41434148 m_mempool.size (), m_mempool.DynamicMemoryUsage () / 1000 );
41444149
41454150 for (const CTransactionRef& removedTx : result.m_replaced_transactions .value ()) {
@@ -4191,7 +4196,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41914196 // DoS prevention: do not allow m_orphanage to grow unbounded (see CVE-2012-3789)
41924197 m_orphanage.LimitOrphans (m_opts.max_orphan_txs );
41934198 } 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 ());
41954202 // We will continue to reject this tx since it has rejected
41964203 // parents so avoid re-requesting it from other peers.
41974204 // 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,
42564263 // regardless of false positives.
42574264
42584265 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 (),
42604269 pfrom.GetId (),
42614270 state.ToString ());
42624271 MaybePunishNodeForTx (pfrom.GetId (), state);
0 commit comments