HomePhabricator

net: avoid unnecessary GetBindAddress() call

Description

net: avoid unnecessary GetBindAddress() call

Summary:
Our local (bind) address is already saved in CNode::addrBind and there
is no need to re-retrieve it again with GetBindAddress().

Also, for I2P connections CNode::addrBind would contain our I2P
address, but GetBindAddress() would return something like
127.0.0.1:RANDOM_PORT.

This is a backport of core#20685 [7/20]
https://github.com/bitcoin/bitcoin/pull/20685/commits/f6c267db3be2d7077fd2bdbd34860eba838dea99

Depends on D11015

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on Nov 24 2020, 14:36
PiRKCommitted on Feb 10 2022, 09:12
PiRKPushed on Feb 10 2022, 09:12
Reviewer
Restricted Project
Differential Revision
D11016: net: avoid unnecessary GetBindAddress() call
Parents
rABCfb406d6140c1: net: isolate the protocol-agnostic part of CConnman::AcceptConnection()
Branches
Unknown
Tags
Unknown