HomePhabricator

net: assert CNode::m_inbound_onion is inbound in ctor, add getter, unit tests

Description

net: assert CNode::m_inbound_onion is inbound in ctor, add getter, unit tests

Summary:

test: fix constructing CNode with invalid inbound_onion

as CNode ctor should only be passed inbound_onion = true
when the connection is inbound

net: assert CNode::m_inbound_onion is inbound in ctor

and drop an unneeded check in CNode::ConnectedThroughNetwork()

net: add CNode::IsInboundOnion() public getter and unit tests

This is a backport of core#20210

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Jon Atack <jon@atack.com>Authored on Dec 17 2020, 15:33
PiRKCommitted on Feb 3 2022, 11:58
PiRKPushed on Feb 3 2022, 11:58
Reviewer
Restricted Project
Differential Revision
D10971: net: assert CNode::m_inbound_onion is inbound in ctor, add getter, unit tests
Parents
rABC00657787e118: test: add check_node_connections in util
Branches
Unknown
Tags
Unknown