mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Parsing the cluster status message, updates to tracking code
This commit is contained in:
@@ -119,6 +119,7 @@ namespace ripple
|
||||
#include "src/cpp/ripple/ripple_Peer.h" // VFALCO TODO Rename to IPeer
|
||||
#include "src/cpp/ripple/ripple_IPeers.h"
|
||||
#include "src/cpp/ripple/ripple_IProofOfWorkFactory.h"
|
||||
#include "src/cpp/ripple/ripple_ClusterNodeStatus.h"
|
||||
#include "src/cpp/ripple/ripple_UniqueNodeList.h"
|
||||
#include "src/cpp/ripple/ripple_IValidations.h"
|
||||
#include "src/cpp/ripple/ripple_PeerSet.h"
|
||||
@@ -174,7 +175,6 @@ namespace ripple
|
||||
#include "src/cpp/ripple/ripple_RippleState.h"
|
||||
#include "src/cpp/ripple/SerializedValidation.h"
|
||||
#include "src/cpp/ripple/AccountSetTransactor.h"
|
||||
#include "src/cpp/ripple/ripple_ClusterNodeStatus.h"
|
||||
#include "src/cpp/ripple/TrustSetTransactor.h"
|
||||
#include "src/cpp/ripple/WSConnection.h"
|
||||
#include "src/cpp/ripple/ripple_WSHandler.h"
|
||||
|
||||
@@ -8,6 +8,9 @@ class ClusterNodeStatus
|
||||
{
|
||||
public:
|
||||
|
||||
ClusterNodeStatus() : mSeq(0), mLoadFee(0), mReportTime(0)
|
||||
{ ; }
|
||||
|
||||
ClusterNodeStatus(std::string const& name) : mNodeName(name), mSeq(0), mLoadFee(0), mReportTime(0)
|
||||
{ ; }
|
||||
|
||||
|
||||
@@ -1420,7 +1420,18 @@ void PeerImp::recvValidation (const boost::shared_ptr<protocol::TMValidation>& p
|
||||
|
||||
void PeerImp::recvCluster (protocol::TMCluster& packet)
|
||||
{
|
||||
if (!mCluster)
|
||||
{
|
||||
applyLoadCharge(LT_UnwantedData);
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < packet.clusternodes().size(); ++i)
|
||||
{
|
||||
protocol::TMClusterNode const& node = packet.clusternodes(i);
|
||||
|
||||
// Extract RippleAddress and build ClusterNodeStatus
|
||||
// WRITEME
|
||||
}
|
||||
}
|
||||
|
||||
void PeerImp::recvGetValidation (protocol::TMGetValidations& packet)
|
||||
|
||||
@@ -322,6 +322,26 @@ public:
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void nodeUpdate (const RippleAddress& naNodePublic, ClusterNodeStatus const& cnsStatus)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl (mUNLLock);
|
||||
m_clusterNodes[naNodePublic].update(cnsStatus);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
std::map<RippleAddress, ClusterNodeStatus> getClusterStatus ()
|
||||
{
|
||||
std::map<RippleAddress, ClusterNodeStatus> ret;
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl (mUNLLock);
|
||||
ret = m_clusterNodes;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void nodeBootstrap ()
|
||||
{
|
||||
int iDomains = 0;
|
||||
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
virtual bool nodeInUNL (const RippleAddress& naNodePublic) = 0;
|
||||
virtual bool nodeInCluster (const RippleAddress& naNodePublic) = 0;
|
||||
virtual bool nodeInCluster (const RippleAddress& naNodePublic, std::string& name) = 0;
|
||||
virtual void nodeUpdate (const RippleAddress& naNodePublic, ClusterNodeStatus const& cnsStatus) = 0;
|
||||
virtual std::map<RippleAddress, ClusterNodeStatus> getClusterStatus () = 0;
|
||||
|
||||
virtual void nodeBootstrap () = 0;
|
||||
virtual bool nodeLoad (boost::filesystem::path pConfig) = 0;
|
||||
|
||||
Reference in New Issue
Block a user