Opportunistic 1p1c relay and orphan resolution fetch a missing parent by txid, but several outcomes are recorded by wtxid, or against a single package member, in ways another peer could exploit. A peer sending a variant of a parent with the same txid and a different or missing witness could make the node drop the honest child, cancel the honest peer's request for the parent, or reject later children of that parent. Each case delays a CPFP package until a new announcer appears or the parent confirms.
This PR fixes four such cases deemed the easiest to accomplish by a direct node peer trying to frustrate 1P1C relay at each individual hop.
There are remaining residuals that are cataloged here in sloppy form: https://gist.github.com/instagibbs/880a76535fd802fced9f9a5253cdbb40
To close these classes of issues by construction, we would have to replace our opportunistic protocol with a sender-initiated one, but that requires a network wide protocol update. This is beyond the scope of this PR and effort, for now.
Follow-up PR enforcing invariants we want to see post-fixes: #36371
Given these are 4 essentially individual fixes, I can also split off fixes to make review easier, but I will keep this PR open in some form to show the scope of the desired changes.
Related minor PR: #36328
Investigation kicked off by a Project Loupe report