HomePhabricator

[avalanche] Make sure to only promote contenders once for each proofid

Description

[avalanche] Make sure to only promote contenders once for each proofid

Summary:
Looping over the contenders container while inserting causes the loop to go over the newly inserted items which is not intended. For better or worse, double inserting a contender has no change in behavior, so this diff does not either.

Depends on D17860

Test Plan:

./test/functional/test_runner.py --nocleanup abc_p2p_avalanche_contender_voting

Verify in the log that when contenders are promoted, "new id <contenderid>" never appears duplicated.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17861

Details

Provenance
roqqitAuthored on Wed, Mar 26, 22:02
roqqitPushed on Thu, Mar 27, 18:00
Reviewer
Restricted Project
Differential Revision
D17861: [avalanche] Make sure to only promote contenders once for each proofid
Parents
rABC6fb44405d40d: [avalanche] Add some logging when stake contenders are cached or promoted
Branches
Unknown
Tags
Unknown