Page MenuHomePhabricator

net_processing: move FindTxForGetData and ProcessGetData to PeerManagerImpl
ClosedPublic

Authored by PiRK on May 6 2022, 15:55.

Details

Summary

Allows making mapRelay and vRelayExpiration members rather than globals.
Remove need to pass mempool of conman to methods?

This is a backport of core#20942 [6&7/9]
https://github.com/bitcoin/bitcoin/pull/20942/commits/34207b9004d2069a8fcb32758cd796143eccfb4d
https://github.com/bitcoin/bitcoin/pull/20942/commits/7b7117efd00acf7609e65d3b4fe5f76e400dda12

Depends on D11435

Notes :

  • also convert a uint256 to TxId in mapRelay type
  • rename g_relay_expiration to vRelayExpiration now that it is no longer a global (undoes a change in D10914). The m_ prefix is not very commonly used in this class, so I feel like it is best to stick with the source material.
Test Plan

ninja all check-all

Diff Detail

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

Event Timeline

PiRK requested review of this revision.May 6 2022, 15:55
Fabien requested changes to this revision.May 9 2022, 10:02
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/net_processing.cpp
814 ↗(On Diff #33441)

The renaming to g_relay_expiration happened after this PR, you should keep that name

2635 ↗(On Diff #33441)

You removed the annotation

This revision now requires changes to proceed.May 9 2022, 10:02
PiRK edited the summary of this revision. (Show Details)

Restore g_relay_expiration var name (I assumed that we intentionnaly diverged from Core, but it is actually an out of order backport from core#21015)
Add lock annotation to FindTxForGetData method declaration

This revision is now accepted and ready to land.May 10 2022, 10:01