message: p2p: enable fetching of orphans from wtxid peers
  Based on a commit by Anthony Towns.
diff: @@ -2665,7 +2665,9 @@ void ProcessMessage(
  if (interruptMsgProc)
  return;
  - // ignore INVs that don't match wtxidrelay setting
  + // Ignore INVs that don't match wtxidrelay setting.
  + // Note that orphan parent fetching always uses MSG_TX GETDATAs regardless of the wtxidrelay setting.
  + // This is fine as no INV messages are involved in that process.
  if (State(pfrom.GetId())->m_wtxid_relay) {
  if (inv.IsMsgTx()) continue;
  } else {
  @@ -2945,9 +2947,11 @@ void ProcessMessage(
  TxValidationState state;
  + for (uint256 hash : {txid, wtxid}) {
  nodestate->m_tx_download.m_tx_announced.erase(hash);
  nodestate->m_tx_download.m_tx_in_flight.erase(hash);
  EraseTxRequest(hash);
  + }
  std::list<CTransactionRef> lRemovedTxn;
  @@ -2999,18 +3003,16 @@ void ProcessMessage(
  uint32_t nFetchFlags = GetFetchFlags(pfrom);
  const auto current_time = GetTime<std::chrono::microseconds>();
  - if (!State(pfrom.GetId())->m_wtxid_relay) {
  for (const CTxIn& txin : tx.vin) {
  // Here, we only have the txid (and not wtxid) of the
  - // inputs, so we only request parents from
  - // non-wtxid-relay peers.
  + // inputs, so we only request in txid mode, even for
  + // wtxidrelay peers.
  // Eventually we should replace this with an improved
  // protocol for getting all unconfirmed parents.
  CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash);
  pfrom.AddKnownTx(txin.prevout.hash);
  if (!AlreadyHave(_inv, mempool)) RequestTx(State(pfrom.GetId()), ToGenTxid(_inv), current_time);
  }
  - }
  AddOrphanTx(ptx, pfrom.GetId());
  // DoS prevention: do not allow mapOrphanTransactions to grow unbounded (see CVE-2012-3789)
  