HomePhabricator

[net] split PushInventory()

Description

[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

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9192

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Jun 18 2020, 19:19
FabienCommitted on Feb 9 2021, 17:08
FabienPushed on Feb 9 2021, 17:09
Reviewer
Restricted Project
Differential Revision
D9192: [net] split PushInventory()
Parents
rABCfcf518ba31d8: net: Use C++11 member initialization in protocol
Branches
Unknown
Tags
Unknown