diff options
author | pasta <pasta@dashboost.org> | 2022-01-31 19:32:59 +0700 |
---|---|---|
committer | pasta <pasta@dashboost.org> | 2022-04-22 09:04:39 -0500 |
commit | ab1ea29ba1b8379a21fabd3dc859552c470a6421 (patch) | |
tree | 799d831027961f820f5472ce75e93f14cd3e5217 /src/net_processing.cpp | |
parent | 505ba3966562b10d6dd4162f3216a120c73a4edb (diff) |
refactor: make GetRand a template, remove GetRandInt
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 8 |
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) { |