mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 11:35:53 +00:00
Use DeadlineTimer in UniqueNodeList
This commit is contained in:
@@ -2492,13 +2492,13 @@ Json::Value RPCHandler::doUnlAdd (Json::Value params, LoadType* loadType, Scoped
|
||||
|
||||
if (raNodePublic.setNodePublic (strNode))
|
||||
{
|
||||
getApp().getUNL ().nodeAddPublic (raNodePublic, IUniqueNodeList::vsManual, strComment);
|
||||
getApp().getUNL ().nodeAddPublic (raNodePublic, UniqueNodeList::vsManual, strComment);
|
||||
|
||||
return "adding node by public key";
|
||||
}
|
||||
else
|
||||
{
|
||||
getApp().getUNL ().nodeAddDomain (strNode, IUniqueNodeList::vsManual, strComment);
|
||||
getApp().getUNL ().nodeAddDomain (strNode, UniqueNodeList::vsManual, strComment);
|
||||
|
||||
return "adding node by domain";
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
return *mValidations;
|
||||
}
|
||||
|
||||
IUniqueNodeList& getUNL ()
|
||||
UniqueNodeList& getUNL ()
|
||||
{
|
||||
return *mUNL;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ private:
|
||||
beast::ScopedPointer <ILoadFeeTrack> mFeeTrack;
|
||||
beast::ScopedPointer <IHashRouter> mHashRouter;
|
||||
beast::ScopedPointer <IValidations> mValidations;
|
||||
beast::ScopedPointer <IUniqueNodeList> mUNL;
|
||||
beast::ScopedPointer <UniqueNodeList> mUNL;
|
||||
beast::ScopedPointer <IProofOfWorkFactory> mProofOfWorkFactory;
|
||||
beast::ScopedPointer <IPeers> mPeers;
|
||||
beast::ScopedPointer <ILoadManager> m_loadManager;
|
||||
@@ -294,7 +294,7 @@ Application::Application ()
|
||||
, mFeeTrack (ILoadFeeTrack::New ())
|
||||
, mHashRouter (IHashRouter::New (IHashRouter::getDefaultHoldTime ()))
|
||||
, mValidations (IValidations::New ())
|
||||
, mUNL (IUniqueNodeList::New (mIOService))
|
||||
, mUNL (UniqueNodeList::New ())
|
||||
, mProofOfWorkFactory (IProofOfWorkFactory::New ())
|
||||
, mPeers (IPeers::New (mIOService))
|
||||
, m_loadManager (ILoadManager::New ())
|
||||
|
||||
@@ -14,7 +14,7 @@ class IHashRouter;
|
||||
class ILoadFeeTrack;
|
||||
class IPeers;
|
||||
class IProofOfWorkFactory;
|
||||
class IUniqueNodeList;
|
||||
class UniqueNodeList;
|
||||
class IValidations;
|
||||
|
||||
class HashedObjectStore;
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
virtual ILoadManager& getLoadManager () = 0;
|
||||
virtual IPeers& getPeers () = 0;
|
||||
virtual IProofOfWorkFactory& getProofOfWorkFactory () = 0;
|
||||
virtual IUniqueNodeList& getUNL () = 0;
|
||||
virtual UniqueNodeList& getUNL () = 0;
|
||||
virtual IValidations& getValidations () = 0;
|
||||
|
||||
virtual HashedObjectStore& getHashedObjectStore () = 0;
|
||||
@@ -82,6 +82,12 @@ public:
|
||||
virtual DatabaseCon* getRpcDB () = 0;
|
||||
virtual DatabaseCon* getTxnDB () = 0;
|
||||
virtual DatabaseCon* getLedgerDB () = 0;
|
||||
|
||||
/** Retrieve the "wallet database"
|
||||
|
||||
It looks like this is used to store the unique node list.
|
||||
*/
|
||||
// VFALCO TODO Rename, document this
|
||||
virtual DatabaseCon* getWalletDB () = 0;
|
||||
// VFALCO NOTE It looks like this isn't used...
|
||||
//virtual DatabaseCon* getNetNodeDB () = 0;
|
||||
|
||||
@@ -1021,7 +1021,7 @@ void PeerImp::recvHello (protocol::TMHello& packet)
|
||||
// Don't save IP address if the node wants privacy.
|
||||
// Note: We don't go so far as to delete it. If a node which has previously announced itself now wants
|
||||
// privacy, it should at least change its port.
|
||||
getApp().getPeers ().savePeer (strIP, iPort, IUniqueNodeList::vsInbound);
|
||||
getApp().getPeers ().savePeer (strIP, iPort, UniqueNodeList::vsInbound);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1468,7 +1468,7 @@ void PeerImp::recvPeers (protocol::TMPeers& packet)
|
||||
{
|
||||
//WriteLog (lsINFO, Peer) << "Peer: Learning: " << addressToString(this) << ": " << i << ": " << strIP << " " << iPort;
|
||||
|
||||
getApp().getPeers ().savePeer (strIP, iPort, IUniqueNodeList::vsTold);
|
||||
getApp().getPeers ().savePeer (strIP, iPort, UniqueNodeList::vsTold);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,8 +401,8 @@ void Peers::connectTo (const std::string& strIp, int iPort)
|
||||
|
||||
db->executeSQL (str (boost::format ("REPLACE INTO PeerIps (IpPort,Score,Source,ScanNext) values (%s,%d,'%c',0);")
|
||||
% sqlEscape (str (boost::format ("%s %d") % strIp % iPort))
|
||||
% getApp().getUNL ().iSourceScore (IUniqueNodeList::vsManual)
|
||||
% char (IUniqueNodeList::vsManual)));
|
||||
% getApp().getUNL ().iSourceScore (UniqueNodeList::vsManual)
|
||||
% char (UniqueNodeList::vsManual)));
|
||||
}
|
||||
|
||||
scanRefresh ();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,10 +4,10 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_IUNIQUENODELIST_H_INCLUDED
|
||||
#define RIPPLE_IUNIQUENODELIST_H_INCLUDED
|
||||
#ifndef RIPPLE_UNIQUENODELIST_H_INCLUDED
|
||||
#define RIPPLE_UNIQUENODELIST_H_INCLUDED
|
||||
|
||||
class IUniqueNodeList
|
||||
class UniqueNodeList
|
||||
{
|
||||
public:
|
||||
enum ValidatorSource
|
||||
@@ -26,9 +26,9 @@ public:
|
||||
|
||||
public:
|
||||
// VFALCO TODO make this not use boost::asio...
|
||||
static IUniqueNodeList* New (boost::asio::io_service& io_service);
|
||||
static UniqueNodeList* New ();
|
||||
|
||||
virtual ~IUniqueNodeList () { }
|
||||
virtual ~UniqueNodeList () { }
|
||||
|
||||
// VFALCO TODO Roll this into the constructor so there is one less state.
|
||||
virtual void start () = 0;
|
||||
Reference in New Issue
Block a user