File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,12 @@ class Node
157
157
// ! Get total bytes sent.
158
158
virtual int64_t getTotalBytesSent () = 0;
159
159
160
+ // ! Set total bytes recv
161
+ virtual void setTotalBytesRecv (uint64_t bytes) = 0;
162
+
163
+ // ! Set total bytes sent
164
+ virtual void setTotalBytesSent (uint64_t bytes) = 0;
165
+
160
166
// ! Get mempool size.
161
167
virtual size_t getMempoolSize () = 0;
162
168
Original file line number Diff line number Diff line change @@ -3779,6 +3779,14 @@ uint64_t CConnman::GetTotalBytesSent() const
3779
3779
return nTotalBytesSent;
3780
3780
}
3781
3781
3782
+ void CConnman::SetTotalBytesRecv (uint64_t bytes) { nTotalBytesRecv.store (bytes); }
3783
+
3784
+ void CConnman::SetTotalBytesSent (uint64_t bytes)
3785
+ {
3786
+ WAIT_LOCK (m_total_bytes_sent_mutex, lock);
3787
+ nTotalBytesSent = bytes;
3788
+ }
3789
+
3782
3790
ServiceFlags CConnman::GetLocalServices () const
3783
3791
{
3784
3792
return m_local_services;
Original file line number Diff line number Diff line change @@ -1261,6 +1261,8 @@ class CConnman
1261
1261
1262
1262
uint64_t GetTotalBytesRecv () const ;
1263
1263
uint64_t GetTotalBytesSent () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex);
1264
+ void SetTotalBytesRecv (uint64_t bytes);
1265
+ void SetTotalBytesSent (uint64_t bytes);
1264
1266
1265
1267
/* * Get a unique deterministic randomizer. */
1266
1268
CSipHasher GetDeterministicRandomizer (uint64_t id) const ;
Original file line number Diff line number Diff line change @@ -285,6 +285,8 @@ class NodeImpl : public Node
285
285
}
286
286
int64_t getTotalBytesRecv () override { return m_context->connman ? m_context->connman ->GetTotalBytesRecv () : 0 ; }
287
287
int64_t getTotalBytesSent () override { return m_context->connman ? m_context->connman ->GetTotalBytesSent () : 0 ; }
288
+ void setTotalBytesRecv (uint64_t bytes) override { if (m_context->connman ) m_context->connman ->SetTotalBytesRecv (bytes); }
289
+ void setTotalBytesSent (uint64_t bytes) override { if (m_context->connman ) m_context->connman ->SetTotalBytesSent (bytes); }
288
290
size_t getMempoolSize () override { return m_context->mempool ? m_context->mempool ->size () : 0 ; }
289
291
size_t getMempoolDynamicUsage () override { return m_context->mempool ? m_context->mempool ->DynamicMemoryUsage () : 0 ; }
290
292
size_t getMempoolMaxUsage () override { return m_context->mempool ? m_context->mempool ->m_opts .max_size_bytes : 0 ; }
You can’t perform that action at this time.
0 commit comments