[avalanche] Fix stake contender unit test occasional failure
Summary:
The sorting algo differs in the test from the node algo if the number of accepted contenders is > AVALANCHE_CONTENDER_MAX_POLLABLE, which is a rare event.
To reproduce you can reduce AVALANCHE_CONTENDER_MAX_POLLABLE to some small number (4 is a good value) and run the test in a loop, it should fail quickly without this patch.
Test Plan:
for i in {1..100}; do echo "Trial $i" && ./src/avalanche/test/test-avalanche -t processor_tests/stake_contender_local_winners || break; done
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D17950