Page MenuHomePhabricator

Fix an unsigned issue in the availability score calculation
ClosedPublic

Authored by Fabien on Jan 13 2022, 20:14.

Details

Summary

The number of votes and polls are stored as unsigned ints for the computation, causing an overflow when 2 * votes - polls is negative. This can happen if a node never responded any poll, and cause the score to turn high instead of going negative. The test case was checking the score response against a rise then fall, so it didn't check for negative values and missed the edge case.

Test Plan
ninja all check

Diff Detail

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