Page MenuHomePhabricator

[avalanche] Pass chainman to Processor
ClosedPublic

Authored by PiRK on Jul 4 2022, 15:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCcba2d5ffc3cb: [avalanche] Pass chainman to Processor
Summary

This removes usage of g_chainman and ::ActiveChainstate() in the Avalanche processor.

Test Plan

ninja all check-all

Diff Detail

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

Event Timeline

Fabien added inline comments.
src/avalanche/processor.h
98 ↗(On Diff #34232)

Is it safe ? Did you check that the ChainstateManager cannot be destructed before the Processor ?

deadalnix added inline comments.
src/avalanche/processor.h
98 ↗(On Diff #34232)

If it does, then the problem is clearly not with this patch, but indeed, checking is necessary.

src/avalanche/processor.h
98 ↗(On Diff #34232)

So I checked that the ChainStateManager is always destroyed last in init.cpp and in the test fixture. But do you guys mean to say that this member should be somehow made foolproof by using some kind of exotic pointer rather than a reference?

src/avalanche/processor.h
98 ↗(On Diff #34232)

Maybe pass a NodeContext to wrap the chainstate in a pointer?

This revision is now accepted and ready to land.Jul 11 2022, 07:30
This revision was automatically updated to reflect the committed changes.