@@ -1128,7 +1128,7 @@ friend class CNode;
1128
1128
* @param[in] max_pct Maximum percentage of addresses to return (0 = all).
1129
1129
* @param[in] network Select only addresses of this network (nullopt = all).
1130
1130
*/
1131
- std::vector<CAddress> GetAddresses (size_t max_addresses, size_t max_pct, std::optional<Network> network);
1131
+ std::vector<CAddress> GetAddresses (size_t max_addresses, size_t max_pct, std::optional<Network> network) const ;
1132
1132
1133
1133
/* *
1134
1134
* Cache is used to minimize topology leaks, so it should
@@ -1141,7 +1141,7 @@ friend class CNode;
1141
1141
// This allows temporarily exceeding m_max_outbound_full_relay, with the goal of finding
1142
1142
// a peer that is better than all our current peers.
1143
1143
void SetTryNewOutboundPeer (bool flag);
1144
- bool GetTryNewOutboundPeer ();
1144
+ bool GetTryNewOutboundPeer () const ;
1145
1145
1146
1146
void StartExtraBlockRelayPeers () {
1147
1147
LogPrint (BCLog::NET, " net: enabling extra block-relay-only peers\n " );
@@ -1154,13 +1154,13 @@ friend class CNode;
1154
1154
// return a value less than (num_outbound_connections - num_outbound_slots)
1155
1155
// in cases where some outbound connections are not yet fully connected, or
1156
1156
// not yet fully disconnected.
1157
- int GetExtraFullOutboundCount ();
1157
+ int GetExtraFullOutboundCount () const ;
1158
1158
// Count the number of block-relay-only peers we have over our limit.
1159
- int GetExtraBlockRelayCount ();
1159
+ int GetExtraBlockRelayCount () const ;
1160
1160
1161
1161
bool AddNode (const std::string& node);
1162
1162
bool RemoveAddedNode (const std::string& node);
1163
- std::vector<AddedNodeInfo> GetAddedNodeInfo ();
1163
+ std::vector<AddedNodeInfo> GetAddedNodeInfo () const ;
1164
1164
1165
1165
/* *
1166
1166
* Attempts to open a connection. Currently only used from tests.
@@ -1187,9 +1187,9 @@ friend class CNode;
1187
1187
bool IsMasternodeQuorumRelayMember (const uint256& protxHash);
1188
1188
void AddPendingProbeConnections (const std::set<uint256>& proTxHashes);
1189
1189
1190
- size_t GetNodeCount (ConnectionDirection);
1190
+ size_t GetNodeCount (ConnectionDirection) const ;
1191
1191
size_t GetMaxOutboundNodeCount ();
1192
- void GetNodeStats (std::vector<CNodeStats>& vstats);
1192
+ void GetNodeStats (std::vector<CNodeStats>& vstats) const ;
1193
1193
bool DisconnectNode (const std::string& node);
1194
1194
bool DisconnectNode (const CSubNet& subnet);
1195
1195
bool DisconnectNode (const CNetAddr& addr);
@@ -1203,24 +1203,24 @@ friend class CNode;
1203
1203
// ! that peer during `net_processing.cpp:PushNodeVersion()`.
1204
1204
ServiceFlags GetLocalServices () const ;
1205
1205
1206
- uint64_t GetMaxOutboundTarget ();
1207
- std::chrono::seconds GetMaxOutboundTimeframe ();
1206
+ uint64_t GetMaxOutboundTarget () const ;
1207
+ std::chrono::seconds GetMaxOutboundTimeframe () const ;
1208
1208
1209
1209
// ! check if the outbound target is reached
1210
1210
// ! if param historicalBlockServingLimit is set true, the function will
1211
1211
// ! response true if the limit for serving historical blocks has been reached
1212
- bool OutboundTargetReached (bool historicalBlockServingLimit);
1212
+ bool OutboundTargetReached (bool historicalBlockServingLimit) const ;
1213
1213
1214
1214
// ! response the bytes left in the current max outbound cycle
1215
1215
// ! in case of no limit, it will always response 0
1216
- uint64_t GetOutboundTargetBytesLeft ();
1216
+ uint64_t GetOutboundTargetBytesLeft () const ;
1217
1217
1218
1218
// ! returns the time left in the current max outbound cycle
1219
1219
// ! in case of no limit, it will always return 0
1220
- std::chrono::seconds GetMaxOutboundTimeLeftInCycle ();
1220
+ std::chrono::seconds GetMaxOutboundTimeLeftInCycle () const ;
1221
1221
1222
- uint64_t GetTotalBytesRecv ();
1223
- uint64_t GetTotalBytesSent ();
1222
+ uint64_t GetTotalBytesRecv () const ;
1223
+ uint64_t GetTotalBytesSent () const ;
1224
1224
1225
1225
/* * Get a unique deterministic randomizer. */
1226
1226
CSipHasher GetDeterministicRandomizer (uint64_t id) const ;
@@ -1344,8 +1344,8 @@ friend class CNode;
1344
1344
void UnregisterEvents (CNode* pnode);
1345
1345
1346
1346
// Network usage totals
1347
- RecursiveMutex cs_totalBytesRecv;
1348
- RecursiveMutex cs_totalBytesSent;
1347
+ mutable RecursiveMutex cs_totalBytesRecv;
1348
+ mutable RecursiveMutex cs_totalBytesSent;
1349
1349
uint64_t nTotalBytesRecv GUARDED_BY (cs_totalBytesRecv) {0 };
1350
1350
uint64_t nTotalBytesSent GUARDED_BY (cs_totalBytesSent) {0 };
1351
1351
@@ -1371,7 +1371,7 @@ friend class CNode;
1371
1371
std::deque<std::string> m_addr_fetches GUARDED_BY (m_addr_fetches_mutex);
1372
1372
RecursiveMutex m_addr_fetches_mutex;
1373
1373
std::vector<std::string> vAddedNodes GUARDED_BY (cs_vAddedNodes);
1374
- RecursiveMutex cs_vAddedNodes;
1374
+ mutable RecursiveMutex cs_vAddedNodes;
1375
1375
std::vector<uint256> vPendingMasternodes;
1376
1376
mutable RecursiveMutex cs_vPendingMasternodes;
1377
1377
std::map<std::pair<Consensus::LLMQType, uint256>, std::set<uint256>> masternodeQuorumNodes GUARDED_BY (cs_vPendingMasternodes);
0 commit comments