@@ -2647,7 +2647,9 @@ void ProcessMessage(
2647
2647
if (interruptMsgProc)
2648
2648
return ;
2649
2649
2650
- // ignore INVs that don't match wtxidrelay setting
2650
+ // Ignore INVs that don't match wtxidrelay setting.
2651
+ // Note that orphan parent fetching always uses MSG_TX GETDATAs regardless of the wtxidrelay setting.
2652
+ // This is fine as no INV messages are involved in that process.
2651
2653
if (State (pfrom.GetId ())->m_wtxid_relay ) {
2652
2654
if (inv.IsMsgTx ()) continue ;
2653
2655
} else {
@@ -2931,9 +2933,11 @@ void ProcessMessage(
2931
2933
2932
2934
TxValidationState state;
2933
2935
2934
- nodestate->m_tx_download .m_tx_announced .erase (hash);
2935
- nodestate->m_tx_download .m_tx_in_flight .erase (hash);
2936
- EraseTxRequest (hash);
2936
+ for (uint256 hash : {txid, wtxid}) {
2937
+ nodestate->m_tx_download .m_tx_announced .erase (hash);
2938
+ nodestate->m_tx_download .m_tx_in_flight .erase (hash);
2939
+ EraseTxRequest (hash);
2940
+ }
2937
2941
2938
2942
std::list<CTransactionRef> lRemovedTxn;
2939
2943
@@ -2985,17 +2989,15 @@ void ProcessMessage(
2985
2989
uint32_t nFetchFlags = GetFetchFlags (pfrom);
2986
2990
const auto current_time = GetTime<std::chrono::microseconds>();
2987
2991
2988
- if (!State (pfrom.GetId ())->m_wtxid_relay ) {
2989
- for (const CTxIn& txin : tx.vin ) {
2990
- // Here, we only have the txid (and not wtxid) of the
2991
- // inputs, so we only request parents from
2992
- // non-wtxid-relay peers.
2993
- // Eventually we should replace this with an improved
2994
- // protocol for getting all unconfirmed parents.
2995
- CInv _inv (MSG_TX | nFetchFlags, txin.prevout .hash );
2996
- pfrom.AddKnownTx (txin.prevout .hash );
2997
- if (!AlreadyHave (_inv, mempool)) RequestTx (State (pfrom.GetId ()), ToGenTxid (_inv), current_time);
2998
- }
2992
+ for (const CTxIn& txin : tx.vin ) {
2993
+ // Here, we only have the txid (and not wtxid) of the
2994
+ // inputs, so we only request in txid mode, even for
2995
+ // wtxidrelay peers.
2996
+ // Eventually we should replace this with an improved
2997
+ // protocol for getting all unconfirmed parents.
2998
+ CInv _inv (MSG_TX | nFetchFlags, txin.prevout .hash );
2999
+ pfrom.AddKnownTx (txin.prevout .hash );
3000
+ if (!AlreadyHave (_inv, mempool)) RequestTx (State (pfrom.GetId ()), ToGenTxid (_inv), current_time);
2999
3001
}
3000
3002
AddOrphanTx (ptx, pfrom.GetId ());
3001
3003
0 commit comments