Page MenuHomePhabricator

[avalanche] Improve API for setContenderStatusForLocalWinners
ClosedPublic

Authored by roqqit on Wed, Feb 12, 19:03.

Details

Summary

These changes make this function more testable and prepares it for
reconciling pollable contenders without re-calling getPollableContenders
unnecessarily.

Inspired by this feedback: https://reviews.bitcoinabc.org/D17607#inline-77172

Test Plan
ninja check-avalanche

Diff Detail

Event Timeline

roqqit requested review of this revision.Wed, Feb 12, 19:03
Fabien requested changes to this revision.Wed, Feb 12, 22:32
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/processor.cpp
926 ↗(On Diff #52626)

You should create another version that takes only pindex to avoid this pattern:

bool Processor::setContenderStatusForLocalWinners(const CBlockIndex *pindex) {
    std::vector<StakeContenderId> dummy;
    return setContenderStatusForLocalWinners(pindex, dummy);
}
This revision now requires changes to proceed.Wed, Feb 12, 22:32
src/avalanche/processor.cpp
926 ↗(On Diff #52626)

I will do this, but I strongly suspect it will be cleaned up in the near future. pollableContenders is supposed to be utilized for polling which is a WIP

Avoid unused pollableContenders at call sites for now

This revision is now accepted and ready to land.Fri, Feb 14, 08:49