Page MenuHomePhabricator

[net] split PushInventory()
ClosedPublic

Authored by Fabien on Tue, Feb 9, 15:28.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC1089bd0c18b1: [net] split PushInventory()
Summary
PushInventory() is currently called with a CInv object, which can be a
MSG_TX or MSG_BLOCK. PushInventory() only uses the type to determine
whether to add the hash to setInventoryTxToSend or
vInventoryBlockToSend.

Since the caller always knows what type of inventory they're pushing,
the CInv is wastefully constructed and thrown away, and tx/block relay
is being split out, we split the function into PushTxInventory() and
PushBlockInventory().

Backport of core PR19322.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.