mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-21 19:34:20 +02:00
refactor: make GetRand a template, remove GetRandInt
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user