aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorpasta <pasta@dashboost.org>2022-01-31 19:32:59 +0700
committerpasta <pasta@dashboost.org>2022-04-22 09:04:39 -0500
commitab1ea29ba1b8379a21fabd3dc859552c470a6421 (patch)
tree799d831027961f820f5472ce75e93f14cd3e5217 /src/net_processing.cpp
parent505ba3966562b10d6dd4162f3216a120c73a4edb (diff)
refactor: make GetRand a template, remove GetRandInt
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 46b4d2e3df..df422fa8e3 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -4470,10 +4470,10 @@ void PeerManagerImpl::MaybeSendPing(CNode& node_to, Peer& peer, std::chrono::mic
}
if (pingSend) {
- uint64_t nonce = 0;
- while (nonce == 0) {
- GetRandBytes({(unsigned char*)&nonce, sizeof(nonce)});
- }
+ uint64_t nonce;
+ do {
+ nonce = GetRand<uint64_t>();
+ } while (nonce == 0);
peer.m_ping_queued = false;
peer.m_ping_start = now;
if (node_to.GetCommonVersion() > BIP0031_VERSION) {