[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