mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Validators work
This commit is contained in:
@@ -28,7 +28,7 @@ class Source : public SharedObject
|
||||
{
|
||||
public:
|
||||
/** A Source's descriptor for a Validator. */
|
||||
struct Info
|
||||
struct Item
|
||||
{
|
||||
/** The unique key for this validator. */
|
||||
RipplePublicKey publicKey;
|
||||
@@ -55,25 +55,26 @@ public:
|
||||
/** A string that is used to recreate the source from the database entry. */
|
||||
virtual String createParam () = 0;
|
||||
|
||||
/** Fetch the most recent list from the Source.
|
||||
This call will block.
|
||||
*/
|
||||
struct Result
|
||||
{
|
||||
Result ();
|
||||
void swapWith (Result& other);
|
||||
|
||||
bool success;
|
||||
String message;
|
||||
Time expirationTime;
|
||||
std::vector <Info> list;
|
||||
};
|
||||
|
||||
/** Cancel any pending fetch.
|
||||
The default implementation does nothing.
|
||||
*/
|
||||
virtual void cancel () { }
|
||||
virtual void fetch (Result& result, Journal journal) = 0;
|
||||
|
||||
/** Fetch results.
|
||||
This call will block
|
||||
*/
|
||||
/** @{ */
|
||||
struct Results
|
||||
{
|
||||
Results ();
|
||||
|
||||
bool success;
|
||||
String message;
|
||||
Time expirationTime;
|
||||
std::vector <Item> list;
|
||||
};
|
||||
virtual void fetch (Results& results, Journal journal) = 0;
|
||||
/** @} */
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -25,9 +25,20 @@ namespace Validators {
|
||||
|
||||
struct ReceivedValidation
|
||||
{
|
||||
RippleLedgerHash ledgerHash;
|
||||
RipplePublicKey publicKey;
|
||||
RipplePublicKeyHash publicKeyHash;
|
||||
ReceivedValidation ()
|
||||
{
|
||||
}
|
||||
|
||||
ReceivedValidation (
|
||||
LedgerHash const& ledgerHash_,
|
||||
RipplePublicKey const& publicKey_)
|
||||
: ledgerHash (ledgerHash_)
|
||||
, publicKey (publicKey_)
|
||||
{
|
||||
}
|
||||
|
||||
RippleLedgerHash ledgerHash;
|
||||
RipplePublicKey publicKey;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user