[avalanche] Avoid O(n2) when voting on proofs
Summary:
This fix the quadratic complexity that occurs when voting on proofs. There is no change in behavior.
Ref T1854.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Maniphest Tasks: T1854
Differential Revision: https://reviews.bitcoinabc.org/D10379