Page MenuHomePhabricator

[avalanche] Make the peermanager methods use a shared pointer to proof
ClosedPublic

Authored by Fabien on Jun 1 2021, 14:23.

Details

Summary

The public interfaces from the processor are not migrated yet and will
be in their own diff so the changes remain easy to review.

Depends on D9607.

Test Plan
ninja all check-all

Event Timeline

Fabien requested review of this revision.Jun 1 2021, 14:23
deadalnix requested changes to this revision.Jun 1 2021, 15:24
deadalnix added a subscriber: deadalnix.

Your strategy seems scary. How are you going to track down all the calls to make_shared<Proof> ?

in any case, don't create copies for no reasons.

src/avalanche/peermanager.cpp
18 ↗(On Diff #28696)

Don't change the behavior in a middle of a refactoring.

24 ↗(On Diff #28696)

No need for move if you pass by const ref.

src/avalanche/peermanager.h
131 ↗(On Diff #28696)

See comment for getPeerId

155 ↗(On Diff #28696)

Don't cause unnecessary copies. Pass by const ref unless you take ownership of a new reference.

186 ↗(On Diff #28696)

dito

This revision now requires changes to proceed.Jun 1 2021, 15:24

Revert behavior change, use const ref to shared pointers, use auto where applicable

This revision is now accepted and ready to land.Jun 2 2021, 12:03