mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-30 23:45:48 +00:00
More Validators implementation
This commit is contained in:
@@ -3,6 +3,11 @@ RIPPLE TODO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Vinnie's List: Changes day to day, descending priority
|
||||
- Validators should delay the application of newly downloaded lists from
|
||||
sources, to mitigate the effects of attacks. Unless there's no validators
|
||||
in the list.
|
||||
- Validators RPC options to immediately apply UNL,
|
||||
manually revisit sources, etc...
|
||||
- Clean up calculation of COnfig file location.
|
||||
- Remove TESTNET and all related code and settings.
|
||||
- Full review of config docs / settings for RPC/WS
|
||||
|
||||
@@ -230,17 +230,15 @@ public:
|
||||
m_validators->addStrings (strings);
|
||||
}
|
||||
|
||||
/*
|
||||
if (getConfig().getValidatorsFile() != File::nonexistent())
|
||||
{
|
||||
m_validators->addFile (getConfig().getValidatorsFile());
|
||||
}
|
||||
*/
|
||||
|
||||
if (! getConfig().getValidatorsURL().empty())
|
||||
{
|
||||
m_validators->addURL (getConfig().getValidatorsURL());
|
||||
}
|
||||
|
||||
if (getConfig().getValidatorsFile() != File::nonexistent ())
|
||||
{
|
||||
m_validators->addFile (getConfig().getValidatorsFile());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -729,7 +729,8 @@ File Config::getValidatorsFile () const
|
||||
|
||||
UniformResourceLocator Config::getValidatorsURL () const
|
||||
{
|
||||
String s = "https://" + VALIDATORS_SITE + VALIDATORS_URI;
|
||||
//String s = "https://" + VALIDATORS_SITE + VALIDATORS_URI;
|
||||
String s = VALIDATORS_SITE;
|
||||
return ParsedURL (s).url ();
|
||||
}
|
||||
|
||||
|
||||
@@ -201,6 +201,7 @@ public:
|
||||
/** Returns the optional URL to a trusted network source of validators. */
|
||||
UniformResourceLocator getValidatorsURL () const;
|
||||
|
||||
// DEPRECATED
|
||||
boost::filesystem::path VALIDATORS_FILE; // As specifed in rippled.cfg.
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@@ -74,7 +74,6 @@ namespace ripple
|
||||
#include "validator/ValidatorSourceURL.cpp"
|
||||
#include "validator/Validators.cpp"
|
||||
|
||||
#include "peerfinder/ripple_PeerFinder.h" // private (for now)
|
||||
#include "peerfinder/ripple_PeerFinder.cpp"
|
||||
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
class ValidatorSourceFileImp : public ValidatorSourceFile
|
||||
{
|
||||
public:
|
||||
ValidatorSourceFileImp (String const& path)
|
||||
: m_path (path)
|
||||
, m_file (File::getCurrentWorkingDirectory().getChildFile (path))
|
||||
ValidatorSourceFileImp (File const& file)
|
||||
: m_file (file)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,16 +24,15 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
String m_path;
|
||||
File m_file;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
ValidatorSourceFile* ValidatorSourceFile::New (String const& path)
|
||||
ValidatorSourceFile* ValidatorSourceFile::New (File const& file)
|
||||
{
|
||||
ScopedPointer <ValidatorSourceFile> object (
|
||||
new ValidatorSourceFileImp (path));
|
||||
new ValidatorSourceFileImp (file));
|
||||
|
||||
return object.release ();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
class ValidatorSourceFile : public Validators::Source
|
||||
{
|
||||
public:
|
||||
static ValidatorSourceFile* New (String const& path);
|
||||
static ValidatorSourceFile* New (File const& path);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
|
||||
if (httpResult.error == 0)
|
||||
{
|
||||
Logger::outputDebugString (httpResult.response->toString ());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -6,6 +6,19 @@
|
||||
|
||||
/*
|
||||
|
||||
Information to track:
|
||||
|
||||
- Percentage of validations that the validator has signed
|
||||
- Number of validations the validator signed that never got accepted
|
||||
|
||||
|
||||
- Target number for Chosen
|
||||
- Pseudo-randomly choose a subset from Chosen
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Goal:
|
||||
|
||||
Provide the listener with a ValidatorList.
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
/** @} */
|
||||
|
||||
/** Add a static source of validators from a text file. */
|
||||
virtual void addFile (String const& path) = 0;
|
||||
virtual void addFile (File const& file) = 0;
|
||||
|
||||
/** Add a static source of validators.
|
||||
The Source is called to fetch once and the results are kept
|
||||
|
||||
@@ -401,9 +401,9 @@ public:
|
||||
ValidatorSourceStrings::New (stringArray));
|
||||
}
|
||||
|
||||
void addFile (String const& path)
|
||||
void addFile (File const& file)
|
||||
{
|
||||
addStaticSource (ValidatorSourceFile::New (path));
|
||||
addStaticSource (ValidatorSourceFile::New (file));
|
||||
}
|
||||
|
||||
void addURL (UniformResourceLocator const& url)
|
||||
|
||||
Reference in New Issue
Block a user