aboutsummaryrefslogtreecommitdiff
path: root/src/random.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-04-15 19:06:59 -0400
committerMartin Zumsande <mzumsande@gmail.com>2022-01-13 15:55:01 +0100
commitbb060746df22c956b8f44e5b8cd1ae4ed73faddc (patch)
tree66201fcfa055bb7cc9de4dc691ff163fa79eb0d6 /src/random.h
parent03cfa1b6035dbcf6a414f9bc432bd9e612801ebb (diff)
downloadbitcoin-bb060746df22c956b8f44e5b8cd1ae4ed73faddc.tar.xz
scripted-diff: replace PoissonNextSend with GetExponentialRand
This distribution is used for more than just the next inv send, so make the name more generic. Also rename to "exponential" to avoid the confusion that this is a poisson distribution. -BEGIN VERIFY SCRIPT- ren() { sed -i "s/\<$1\>/$2/g" $(git grep -l "$1" ./src) ; } ren PoissonNextSend GetExponentialRand ren "a poisson timer" "an exponential timer" -END VERIFY SCRIPT-
Diffstat (limited to 'src/random.h')
-rw-r--r--src/random.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/random.h b/src/random.h
index be73e44a87..5174c553fb 100644
--- a/src/random.h
+++ b/src/random.h
@@ -92,7 +92,7 @@ constexpr auto GetRandMillis = GetRandomDuration<std::chrono::milliseconds>;
* The probability of an event occuring before time x is 1 - e^-(x/a) where a
* is the average interval between events.
* */
-std::chrono::microseconds PoissonNextSend(std::chrono::microseconds now, std::chrono::seconds average_interval);
+std::chrono::microseconds GetExponentialRand(std::chrono::microseconds now, std::chrono::seconds average_interval);
int GetRandInt(int nMax) noexcept;
uint256 GetRandHash() noexcept;