Page MenuHomePhabricator

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

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

Details

Summary

Similar to what is done for the peermanager, the processor can benefit
for dealing with proof shared pointers.

Depends on D9616.

Test Plan
ninja all check-all

Diff Detail

Event Timeline

Fabien requested review of this revision.Jun 1 2021, 14:31
deadalnix requested changes to this revision.Jun 1 2021, 15:30
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/avalanche/processor.cpp
257

Start with a smart pointer instead of doing these.

446

const ref

449

and you won't need a move

src/avalanche/processor.h
292

const ref

src/avalanche/test/processor_tests.cpp
131

It's been several instance of GetProof that lead to a make_shared, this is indicative of a problem.

132

dito

src/rpc/avalanche.cpp
94

You are taking a reference to a temporary. Just revert.

This revision now requires changes to proceed.Jun 1 2021, 15:30
deadalnix requested changes to this revision.Jun 2 2021, 12:05
deadalnix added inline comments.
src/avalanche/processor.cpp
218 ↗(On Diff #28716)

Just assign something, reset is really cumbrsome.

This revision now requires changes to proceed.Jun 2 2021, 12:05
This revision is now accepted and ready to land.Jun 2 2021, 14:18
This revision was landed with ongoing or failed builds.Jun 2 2021, 15:45
This revision was automatically updated to reflect the committed changes.