Skip to content

Commit

Permalink
Net: CConnman: Make some methods const
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimon committed Jan 31, 2017
1 parent e99f0d7 commit d45955f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/net.cpp
Expand Up @@ -754,7 +754,7 @@ const uint256& CNetMessage::GetMessageHash() const


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

CSipHasher CConnman::GetDeterministicRandomizer(uint64_t id)
CSipHasher CConnman::GetDeterministicRandomizer(uint64_t id) const
{
return CSipHasher(nSeed0, nSeed1).Write(id);
}

uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad)
uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const
{
std::vector<unsigned char> vchNetGroup(ad.GetGroup());

Expand Down
6 changes: 3 additions & 3 deletions src/net.h
Expand Up @@ -321,7 +321,7 @@ class CConnman
int GetBestHeight() const;

/** Get a unique deterministic randomizer. */
CSipHasher GetDeterministicRandomizer(uint64_t id);
CSipHasher GetDeterministicRandomizer(uint64_t id) const;

unsigned int GetReceiveFloodSize() const;

Expand All @@ -342,7 +342,7 @@ class CConnman
void ThreadSocketHandler();
void ThreadDNSAddressSeed();

uint64_t CalculateKeyedNetGroup(const CAddress& ad);
uint64_t CalculateKeyedNetGroup(const CAddress& ad) const;

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

NodeId GetNewNodeId();

size_t SocketSendData(CNode *pnode);
size_t SocketSendData(CNode *pnode) const;
//!check is the banlist has unwritten changes
bool BannedSetIsDirty();
//!set the "dirty" flag for the banlist
Expand Down

0 comments on commit d45955f

Please sign in to comment.