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

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

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 ↗(On Diff #28697)

Start with a smart pointer instead of doing these.

446 ↗(On Diff #28697)

const ref

449 ↗(On Diff #28697)

and you won't need a move

src/avalanche/processor.h
292 ↗(On Diff #28697)

const ref

src/avalanche/test/processor_tests.cpp
131 ↗(On Diff #28697)

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

132 ↗(On Diff #28697)

dito

src/rpc/avalanche.cpp
94 ↗(On Diff #28697)

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.