mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 05:55:51 +00:00
Use DeadlineTimer in UniqueNodeList
This commit is contained in:
@@ -1445,7 +1445,7 @@
|
|||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_InfoSub.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_InfoSub.h" />
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_IPeers.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_IPeers.h" />
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_IProofOfWorkFactory.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_IProofOfWorkFactory.h" />
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_IUniqueNodeList.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_UniqueNodeList.h" />
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_IValidations.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_IValidations.h" />
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_LedgerConsensus.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_LedgerConsensus.h" />
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_LedgerEntrySet.h" />
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_LedgerEntrySet.h" />
|
||||||
|
|||||||
@@ -97,9 +97,6 @@
|
|||||||
<Filter Include="[0] Subtrees\leveldb\port\win">
|
<Filter Include="[0] Subtrees\leveldb\port\win">
|
||||||
<UniqueIdentifier>{223ac5ce-c9a0-4196-9b75-4f5fbe8bfa00}</UniqueIdentifier>
|
<UniqueIdentifier>{223ac5ce-c9a0-4196-9b75-4f5fbe8bfa00}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="[1] Ripple\ripple_app\_consensus">
|
|
||||||
<UniqueIdentifier>{82a6d3f3-fa01-4cc6-9730-f928e61b9929}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="[1] Ripple\ripple_app\_contracts">
|
<Filter Include="[1] Ripple\ripple_app\_contracts">
|
||||||
<UniqueIdentifier>{46bda3c0-166b-4188-8f6b-da6f6ff638fc}</UniqueIdentifier>
|
<UniqueIdentifier>{46bda3c0-166b-4188-8f6b-da6f6ff638fc}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
@@ -145,6 +142,9 @@
|
|||||||
<Filter Include="[1] Ripple\ripple_net\basics">
|
<Filter Include="[1] Ripple\ripple_net\basics">
|
||||||
<UniqueIdentifier>{febf2e7e-f071-4a6c-9b81-68498fc8ea57}</UniqueIdentifier>
|
<UniqueIdentifier>{febf2e7e-f071-4a6c-9b81-68498fc8ea57}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="[1] Ripple\ripple_app\_misc\_consensus">
|
||||||
|
<UniqueIdentifier>{82a6d3f3-fa01-4cc6-9730-f928e61b9929}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\Subtrees\sqlite\sqlite3.c">
|
<ClCompile Include="..\..\Subtrees\sqlite\sqlite3.c">
|
||||||
@@ -535,10 +535,10 @@
|
|||||||
<Filter>[1] Ripple\ripple_app\_contracts</Filter>
|
<Filter>[1] Ripple\ripple_app\_contracts</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\cpp\ripple\ripple_DisputedTx.cpp">
|
<ClCompile Include="..\..\src\cpp\ripple\ripple_DisputedTx.cpp">
|
||||||
<Filter>[1] Ripple\ripple_app\_consensus</Filter>
|
<Filter>[1] Ripple\ripple_app\_misc\_consensus</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\cpp\ripple\ripple_LedgerConsensus.cpp">
|
<ClCompile Include="..\..\src\cpp\ripple\ripple_LedgerConsensus.cpp">
|
||||||
<Filter>[1] Ripple\ripple_app\_consensus</Filter>
|
<Filter>[1] Ripple\ripple_app\_misc\_consensus</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\src\cpp\ripple\ripple_Database.cpp">
|
<ClCompile Include="..\..\src\cpp\ripple\ripple_Database.cpp">
|
||||||
<Filter>[1] Ripple\ripple_app\_data</Filter>
|
<Filter>[1] Ripple\ripple_app\_data</Filter>
|
||||||
@@ -1285,10 +1285,10 @@
|
|||||||
<Filter>[1] Ripple\ripple_app\_contracts</Filter>
|
<Filter>[1] Ripple\ripple_app\_contracts</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_DisputedTx.h">
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_DisputedTx.h">
|
||||||
<Filter>[1] Ripple\ripple_app\_consensus</Filter>
|
<Filter>[1] Ripple\ripple_app\_misc\_consensus</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_LedgerConsensus.h">
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_LedgerConsensus.h">
|
||||||
<Filter>[1] Ripple\ripple_app\_consensus</Filter>
|
<Filter>[1] Ripple\ripple_app\_misc\_consensus</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_Database.h">
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_Database.h">
|
||||||
<Filter>[1] Ripple\ripple_app\_data</Filter>
|
<Filter>[1] Ripple\ripple_app\_data</Filter>
|
||||||
@@ -1416,9 +1416,6 @@
|
|||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_PeerSet.h">
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_PeerSet.h">
|
||||||
<Filter>[1] Ripple\ripple_app\_peers</Filter>
|
<Filter>[1] Ripple\ripple_app\_peers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_IUniqueNodeList.h">
|
|
||||||
<Filter>[1] Ripple\ripple_app\_peers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_IPeers.h">
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_IPeers.h">
|
||||||
<Filter>[1] Ripple\ripple_app\_peers</Filter>
|
<Filter>[1] Ripple\ripple_app\_peers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -1584,6 +1581,9 @@
|
|||||||
<ClInclude Include="..\..\src\cpp\ripple\ripple_WSHandler.h">
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_WSHandler.h">
|
||||||
<Filter>[1] Ripple\ripple_app\_network</Filter>
|
<Filter>[1] Ripple\ripple_app\_network</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\cpp\ripple\ripple_UniqueNodeList.h">
|
||||||
|
<Filter>[1] Ripple\ripple_app\_peers</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<CustomBuild Include="..\..\src\cpp\ripple\ripple.proto" />
|
<CustomBuild Include="..\..\src\cpp\ripple\ripple.proto" />
|
||||||
|
|||||||
3
TODO.txt
3
TODO.txt
@@ -2,6 +2,9 @@
|
|||||||
RIPPLE TODO
|
RIPPLE TODO
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
- Roll a simple wrapper for sqlite relational stuff like loading the UNL
|
||||||
|
Completely hide the specifics of SQLite and/or beast::db
|
||||||
|
|
||||||
- Tidy up convenience functions in RPC.h
|
- Tidy up convenience functions in RPC.h
|
||||||
|
|
||||||
- Maybe rename RPCServer to RPCClientServicer
|
- Maybe rename RPCServer to RPCClientServicer
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace ripple
|
|||||||
#include "src/cpp/ripple/ripple_Peer.h" // VFALCO TODO Rename to IPeer
|
#include "src/cpp/ripple/ripple_Peer.h" // VFALCO TODO Rename to IPeer
|
||||||
#include "src/cpp/ripple/ripple_IPeers.h"
|
#include "src/cpp/ripple/ripple_IPeers.h"
|
||||||
#include "src/cpp/ripple/ripple_IProofOfWorkFactory.h"
|
#include "src/cpp/ripple/ripple_IProofOfWorkFactory.h"
|
||||||
#include "src/cpp/ripple/ripple_IUniqueNodeList.h"
|
#include "src/cpp/ripple/ripple_UniqueNodeList.h"
|
||||||
#include "src/cpp/ripple/ripple_IValidations.h"
|
#include "src/cpp/ripple/ripple_IValidations.h"
|
||||||
#include "src/cpp/ripple/ripple_PeerSet.h"
|
#include "src/cpp/ripple/ripple_PeerSet.h"
|
||||||
#include "src/cpp/ripple/ripple_InboundLedger.h"
|
#include "src/cpp/ripple/ripple_InboundLedger.h"
|
||||||
|
|||||||
@@ -2492,13 +2492,13 @@ Json::Value RPCHandler::doUnlAdd (Json::Value params, LoadType* loadType, Scoped
|
|||||||
|
|
||||||
if (raNodePublic.setNodePublic (strNode))
|
if (raNodePublic.setNodePublic (strNode))
|
||||||
{
|
{
|
||||||
getApp().getUNL ().nodeAddPublic (raNodePublic, IUniqueNodeList::vsManual, strComment);
|
getApp().getUNL ().nodeAddPublic (raNodePublic, UniqueNodeList::vsManual, strComment);
|
||||||
|
|
||||||
return "adding node by public key";
|
return "adding node by public key";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getApp().getUNL ().nodeAddDomain (strNode, IUniqueNodeList::vsManual, strComment);
|
getApp().getUNL ().nodeAddDomain (strNode, UniqueNodeList::vsManual, strComment);
|
||||||
|
|
||||||
return "adding node by domain";
|
return "adding node by domain";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
return *mValidations;
|
return *mValidations;
|
||||||
}
|
}
|
||||||
|
|
||||||
IUniqueNodeList& getUNL ()
|
UniqueNodeList& getUNL ()
|
||||||
{
|
{
|
||||||
return *mUNL;
|
return *mUNL;
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ private:
|
|||||||
beast::ScopedPointer <ILoadFeeTrack> mFeeTrack;
|
beast::ScopedPointer <ILoadFeeTrack> mFeeTrack;
|
||||||
beast::ScopedPointer <IHashRouter> mHashRouter;
|
beast::ScopedPointer <IHashRouter> mHashRouter;
|
||||||
beast::ScopedPointer <IValidations> mValidations;
|
beast::ScopedPointer <IValidations> mValidations;
|
||||||
beast::ScopedPointer <IUniqueNodeList> mUNL;
|
beast::ScopedPointer <UniqueNodeList> mUNL;
|
||||||
beast::ScopedPointer <IProofOfWorkFactory> mProofOfWorkFactory;
|
beast::ScopedPointer <IProofOfWorkFactory> mProofOfWorkFactory;
|
||||||
beast::ScopedPointer <IPeers> mPeers;
|
beast::ScopedPointer <IPeers> mPeers;
|
||||||
beast::ScopedPointer <ILoadManager> m_loadManager;
|
beast::ScopedPointer <ILoadManager> m_loadManager;
|
||||||
@@ -294,7 +294,7 @@ Application::Application ()
|
|||||||
, mFeeTrack (ILoadFeeTrack::New ())
|
, mFeeTrack (ILoadFeeTrack::New ())
|
||||||
, mHashRouter (IHashRouter::New (IHashRouter::getDefaultHoldTime ()))
|
, mHashRouter (IHashRouter::New (IHashRouter::getDefaultHoldTime ()))
|
||||||
, mValidations (IValidations::New ())
|
, mValidations (IValidations::New ())
|
||||||
, mUNL (IUniqueNodeList::New (mIOService))
|
, mUNL (UniqueNodeList::New ())
|
||||||
, mProofOfWorkFactory (IProofOfWorkFactory::New ())
|
, mProofOfWorkFactory (IProofOfWorkFactory::New ())
|
||||||
, mPeers (IPeers::New (mIOService))
|
, mPeers (IPeers::New (mIOService))
|
||||||
, m_loadManager (ILoadManager::New ())
|
, m_loadManager (ILoadManager::New ())
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class IHashRouter;
|
|||||||
class ILoadFeeTrack;
|
class ILoadFeeTrack;
|
||||||
class IPeers;
|
class IPeers;
|
||||||
class IProofOfWorkFactory;
|
class IProofOfWorkFactory;
|
||||||
class IUniqueNodeList;
|
class UniqueNodeList;
|
||||||
class IValidations;
|
class IValidations;
|
||||||
|
|
||||||
class HashedObjectStore;
|
class HashedObjectStore;
|
||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
virtual ILoadManager& getLoadManager () = 0;
|
virtual ILoadManager& getLoadManager () = 0;
|
||||||
virtual IPeers& getPeers () = 0;
|
virtual IPeers& getPeers () = 0;
|
||||||
virtual IProofOfWorkFactory& getProofOfWorkFactory () = 0;
|
virtual IProofOfWorkFactory& getProofOfWorkFactory () = 0;
|
||||||
virtual IUniqueNodeList& getUNL () = 0;
|
virtual UniqueNodeList& getUNL () = 0;
|
||||||
virtual IValidations& getValidations () = 0;
|
virtual IValidations& getValidations () = 0;
|
||||||
|
|
||||||
virtual HashedObjectStore& getHashedObjectStore () = 0;
|
virtual HashedObjectStore& getHashedObjectStore () = 0;
|
||||||
@@ -82,6 +82,12 @@ public:
|
|||||||
virtual DatabaseCon* getRpcDB () = 0;
|
virtual DatabaseCon* getRpcDB () = 0;
|
||||||
virtual DatabaseCon* getTxnDB () = 0;
|
virtual DatabaseCon* getTxnDB () = 0;
|
||||||
virtual DatabaseCon* getLedgerDB () = 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;
|
virtual DatabaseCon* getWalletDB () = 0;
|
||||||
// VFALCO NOTE It looks like this isn't used...
|
// VFALCO NOTE It looks like this isn't used...
|
||||||
//virtual DatabaseCon* getNetNodeDB () = 0;
|
//virtual DatabaseCon* getNetNodeDB () = 0;
|
||||||
|
|||||||
@@ -1021,7 +1021,7 @@ void PeerImp::recvHello (protocol::TMHello& packet)
|
|||||||
// Don't save IP address if the node wants privacy.
|
// 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
|
// 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.
|
// 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;
|
//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);")
|
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))
|
% sqlEscape (str (boost::format ("%s %d") % strIp % iPort))
|
||||||
% getApp().getUNL ().iSourceScore (IUniqueNodeList::vsManual)
|
% getApp().getUNL ().iSourceScore (UniqueNodeList::vsManual)
|
||||||
% char (IUniqueNodeList::vsManual)));
|
% char (UniqueNodeList::vsManual)));
|
||||||
}
|
}
|
||||||
|
|
||||||
scanRefresh ();
|
scanRefresh ();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,10 +4,10 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#ifndef RIPPLE_IUNIQUENODELIST_H_INCLUDED
|
#ifndef RIPPLE_UNIQUENODELIST_H_INCLUDED
|
||||||
#define RIPPLE_IUNIQUENODELIST_H_INCLUDED
|
#define RIPPLE_UNIQUENODELIST_H_INCLUDED
|
||||||
|
|
||||||
class IUniqueNodeList
|
class UniqueNodeList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ValidatorSource
|
enum ValidatorSource
|
||||||
@@ -26,9 +26,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// VFALCO TODO make this not use boost::asio...
|
// 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.
|
// VFALCO TODO Roll this into the constructor so there is one less state.
|
||||||
virtual void start () = 0;
|
virtual void start () = 0;
|
||||||
Reference in New Issue
Block a user