Skip to content

Commit d45955f

Browse files
committed
Net: CConnman: Make some methods const
1 parent e99f0d7 commit d45955f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/net.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ const uint256& CNetMessage::GetMessageHash() const
754754

755755

756756
// requires LOCK(cs_vSend)
757-
size_t CConnman::SocketSendData(CNode *pnode)
757+
size_t CConnman::SocketSendData(CNode *pnode) const
758758
{
759759
auto it = pnode->vSendMsg.begin();
760760
size_t nSentSize = 0;
@@ -2687,12 +2687,12 @@ int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds) {
26872687
return nNow + (int64_t)(log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */) * average_interval_seconds * -1000000.0 + 0.5);
26882688
}
26892689

2690-
CSipHasher CConnman::GetDeterministicRandomizer(uint64_t id)
2690+
CSipHasher CConnman::GetDeterministicRandomizer(uint64_t id) const
26912691
{
26922692
return CSipHasher(nSeed0, nSeed1).Write(id);
26932693
}
26942694

2695-
uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad)
2695+
uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const
26962696
{
26972697
std::vector<unsigned char> vchNetGroup(ad.GetGroup());
26982698

src/net.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ class CConnman
321321
int GetBestHeight() const;
322322

323323
/** Get a unique deterministic randomizer. */
324-
CSipHasher GetDeterministicRandomizer(uint64_t id);
324+
CSipHasher GetDeterministicRandomizer(uint64_t id) const;
325325

326326
unsigned int GetReceiveFloodSize() const;
327327

@@ -342,7 +342,7 @@ class CConnman
342342
void ThreadSocketHandler();
343343
void ThreadDNSAddressSeed();
344344

345-
uint64_t CalculateKeyedNetGroup(const CAddress& ad);
345+
uint64_t CalculateKeyedNetGroup(const CAddress& ad) const;
346346

347347
CNode* FindNode(const CNetAddr& ip);
348348
CNode* FindNode(const CSubNet& subNet);
@@ -357,7 +357,7 @@ class CConnman
357357

358358
NodeId GetNewNodeId();
359359

360-
size_t SocketSendData(CNode *pnode);
360+
size_t SocketSendData(CNode *pnode) const;
361361
//!check is the banlist has unwritten changes
362362
bool BannedSetIsDirty();
363363
//!set the "dirty" flag for the banlist

0 commit comments

Comments
 (0)