mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-11 03:07:01 +00:00
* Fix random distribution in bitArray.PickRandom Previously it was very biased. 63 "_" followed by a single "x" had much greater odds of being chosen. Additionally, the last element was skewed. This fixes that by first preproccessing the set of all true indices, and then randomly selecting a single element from there. This commit also makes the code here significantly simpler, and improves test cases. * unlock mtx right after we select true indices
9.5 KiB
9.5 KiB