Page MenuHomePhabricator

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

Authored by Fabien on Tue, Jun 1, 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Tue, Jun 1, 14:23
deadalnix requested changes to this revision.Tue, Jun 1, 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.Tue, Jun 1, 15:24

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

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