HomePhabricator

[net processing] Refactor MaybeSendAddr() - early exits

Description

[net processing] Refactor MaybeSendAddr() - early exits

Summary:
Add early exit guard clauses if node.RelayAddrsWithConn() is false or if
current_time < node.m_next_addr_send. Add comments.

This is a backport of core#21236 [5/6]
https://github.com/bitcoin/bitcoin/pull/21236/commits/38c0be5da3af17208b165e73cee7612d3670b038
https://github.com/bitcoin/bitcoin/pull/21236/commits/01a79ff924b11f91796d4aa63c571897b047ac7d

Depends on D10918

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Feb 28 2021, 11:16
PiRKCommitted on Jan 28 2022, 07:08
PiRKPushed on Jan 28 2022, 07:08
Reviewer
Restricted Project
Differential Revision
D10919: [net processing] Refactor MaybeSendAddr() - early exits
Parents
rABC79cc0dca6fcc: [net processing] Change MaybeSendAddr() to take a reference
Branches
Unknown
Tags
Unknown