Page MenuHomePhabricator

p2p: ensure inv is GenMsgTx before ToGenTxid in inv processing
ClosedPublic

Authored by Fabien on May 12 2021, 14:15.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable