HomePhabricator

[avalanche] Extract out a method to add or update a node

Description

[avalanche] Extract out a method to add or update a node

Summary:
The current PeerManager::addNode() API fetches the peer, checks the
delegation, adds or updates the node, then updates the node count on the
peer. The last 2 operations are extracted in another private method so
it can be called independently. This will be used for delaying node
addition when the peer proof has not been discovered yet.

Depends on D9699.

There is no change in behavior.

Ref T1634.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Maniphest Tasks: T1634

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

Details

Provenance
FabienAuthored on Jun 24 2021, 09:45
FabienPushed on Jun 24 2021, 19:25
Reviewer
Restricted Project
Differential Revision
D9698: [avalanche] Extract out a method to add or update a node
Parents
rABCb611b7a4fb0c: [avalanche] Consistently use node as a shortcut for self.nodes[0]
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task