mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
More cluster status work.
This commit is contained in:
@@ -342,6 +342,35 @@ public:
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
uint32 getClusterFee ()
|
||||
{
|
||||
uint64 totFee = 0;
|
||||
int totCount = 0;
|
||||
|
||||
int thresh = getApp().getOPs().getNetworkTimeNC();
|
||||
if (thresh <= 120)
|
||||
thresh = 1;
|
||||
else
|
||||
thresh -= 120;
|
||||
|
||||
boost::recursive_mutex::scoped_lock sl (mUNLLock);
|
||||
{
|
||||
for (std::map<RippleAddress, ClusterNodeStatus>::iterator it = m_clusterNodes.begin(),
|
||||
end = m_clusterNodes.end(); it != end; ++it)
|
||||
{
|
||||
if (it->second.getReportTime() >= thresh)
|
||||
{
|
||||
++totCount;
|
||||
totFee += it->second.getLoadFee();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (totCount == 0) ? 0 : static_cast<uint32>(totFee / totCount);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void nodeBootstrap ()
|
||||
{
|
||||
int iDomains = 0;
|
||||
|
||||
Reference in New Issue
Block a user