HomePhabricator

[avalanche] Turn fetchOrCreatePeer into createPeer

Description

[avalanche] Turn fetchOrCreatePeer into createPeer

Summary:
This diff simplifies fetchOrCreatePeer to turn it into createPeer().

The fetch part is never used, so we can avoid a lookup. Proof validation is moved to the proof registration level, because this is a proof operation and not peer related. Removing from the orphan pool is also no longer needed as we previously checked the proof is not an orphan.

This is a first step toward decoupling proof registration from peer registration. The goal is to have an avalanche utxo map to which we can bind proofs, and use that as the source data to determine if a peer needs to be created.

Utxo attachement will be moved in a follow up.

Ref T1854.

Depends on D10440.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Maniphest Tasks: T1854

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

Details

Provenance
FabienAuthored on Nov 10 2021, 09:46
FabienPushed on Nov 24 2021, 07:41
Reviewer
Restricted Project
Differential Revision
D10453: [avalanche] Turn fetchOrCreatePeer into createPeer
Parents
rABCefefb9f9f10b: Fix several -Wdeprecated-copy warnings
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task