Page MenuHomePhabricator

[avalanche] Make removeProof easier to reason about by taking a proofid
ClosedPublic

Authored by Fabien on Dec 15 2021, 13:13.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABCad126cff6afe: [avalanche] Make removeProof easier to reason about by taking a proofid
Summary

The ProofPool container stores a proof reference but index them by their proof id. Having removeProof() take the proof ref makes it unclear that we are removing a proof with the same id and not a proof reference with the same underlying pointer, so this diff updates the API to take a proof id instead.

The proof id is still passed by value, as the common use case is to get a reference from proof->getId(). Since there might be several entries for that proof id (1 per utxo), the proof might be deleted and the id reference dangling as the erasure loop is processed.

Ref T1854.

Test Plan
ninja all check

Diff Detail

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