Page MenuHomePhabricator

[avalanche] Turn fetchOrCreatePeer into createPeer
ClosedPublic

Authored by Fabien on Nov 10 2021, 09:54.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABCd10643f30435: [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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_fetchorcreatePeer
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17277
Build 34382: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-clang · build-debug · build-clang-tidy
Build 34381: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Nov 10 2021, 09:54

Rebase, add a safety guard to prevent creating a peer twice

This revision is now accepted and ready to land.Nov 24 2021, 01:18