mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 03:39:48 +02:00
test: refactor: Accept any RandomNumberGenerator in RandMoney
Accepting any Rng in RandMoney makes tests more flexible to use a different Rng. Also, passing in the Rng clarifies the call sites, so that they all use g_rand_ctx explicitly and consistently.
This commit is contained in:
@@ -182,7 +182,7 @@ void SimulationTest(CCoinsView* base, bool fake_best_block)
|
||||
|
||||
if (InsecureRandRange(5) == 0 || coin.IsSpent()) {
|
||||
Coin newcoin;
|
||||
newcoin.out.nValue = InsecureRandMoneyAmount();
|
||||
newcoin.out.nValue = RandMoney(m_rng);
|
||||
newcoin.nHeight = 1;
|
||||
|
||||
// Infrequently test adding unspendable coins.
|
||||
|
||||
Reference in New Issue
Block a user