p2p: ensure inv is GenMsgTx before ToGenTxid in inv processing
Summary:
and otherwise log that an unknown INV type was received. In INV processing, when handling transaction type inv messages, ToGenTxid() expects that we constructed the CInv ourselves or that we verified that it is for a transaction type CInv. Therefore, change this `else` branch into an `else if (inv.GenMsgTx())` to make this safer and log any INVs that fall through.
Completes backport of core#19610:
https://github.com/bitcoin/bitcoin/pull/19610/commits/fb56d37612dea6666e7da73d671311a697570dae
Depends on D9507.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9508