Page MenuHomePhabricator

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

Authored by Fabien on Tue, Jun 1, 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.Tue, Jun 1, 14:31
deadalnix requested changes to this revision.Tue, Jun 1, 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.Tue, Jun 1, 15:30
deadalnix requested changes to this revision.Wed, Jun 2, 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.Wed, Jun 2, 12:05
This revision is now accepted and ready to land.Wed, Jun 2, 14:18
This revision was landed with ongoing or failed builds.Wed, Jun 2, 15:45
This revision was automatically updated to reflect the committed changes.