aboutsummaryrefslogtreecommitdiff
path: root/src/txrequest.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2024-03-10 23:38:31 -0400
committerPieter Wuille <pieter@wuille.net>2024-07-01 10:26:46 -0400
commite2d1f84858485650ff743753ffa5c679f210a992 (patch)
tree80485673fd7588be09c319ece6a9d05cac6fa17d /src/txrequest.cpp
parent810cdf6b4e12a1fdace7998d75b4daf8b67d7028 (diff)
random: make GetRand() support entire range (incl. max)
The existing code uses GetRand(nMax), with a default value for nMax, where nMax is the range of values (not the maximum!) that the output is allowed to take. This will always miss the last possible value (e.g. GetRand<uint32_t>() will never return 0xffffffff). Fix this, by moving the functionality largely in RandomMixin, and also adding a separate RandomMixin::rand function, which returns a value in the entire (non-negative) range of an integer.
Diffstat (limited to 'src/txrequest.cpp')
0 files changed, 0 insertions, 0 deletions