Persistence for Validators

This commit is contained in:
Vinnie Falco
2013-09-12 21:38:29 -07:00
parent 9b40bc6835
commit c631cc5f92
18 changed files with 971 additions and 239 deletions

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================
#ifndef RIPPLE_VALIDATORS_SOURCEDESC_H_INCLUDED
#define RIPPLE_VALIDATORS_SOURCEDESC_H_INCLUDED
namespace Validators
{
/** Additional state information associated with a Source. */
struct SourceDesc
{
enum Status
{
statusNone,
statusFetched,
statusFailed
};
ScopedPointer <Source> source;
Status status;
Time whenToFetch;
int numberOfFailures;
// The result of the last fetch
Source::Result result;
//------------------------------------------------------------------
/** The time of the last successful fetch. */
Time lastFetchTime;
/** When to expire this source's list of cached results (if any) */
Time expirationTime;
//------------------------------------------------------------------
SourceDesc () noexcept
: status (statusNone)
, whenToFetch (Time::getCurrentTime ())
, numberOfFailures (0)
{
}
~SourceDesc ()
{
}
};
typedef DynamicList <SourceDesc> SourcesType;
}
#endif