4240 | } else {
4241 | LogPrintf("Force relaying tx %s (wtxid=%s) from peer=%d\n",
4242 | - tx.GetHash().ToString(), tx.GetWitnessHash().ToString(), pfrom.GetId());
4243 | - RelayTransaction(tx.GetHash(), tx.GetWitnessHash());
4244 | + txid.ToString(), wtxid.ToString(), pfrom.GetId());
4245 | + RelayTransaction(txid, wtxid);
not sure. This seems like a pessimization that makes it harder to use the type-safe Txid and Wtxid in RelayTransaction
It would be better to make this code type-safe, to avoid having to touch it again in the future.
If that is the case, shouldn't we be enforcing RelayTransaction to take Txid and Wtxid instead of uint256?
Yes. Alternatively, at a minimum the txid and wtxid types should be adjusted here. Otherwise, this refactor may cause a silent merge conflict with the type-safety refactor.
I've updated the approach to enforce RelayTransaction types, and extended it to all other calls to the method