Consensus ledger switch improvements

* Expire validations faster based on when we first saw them.
* Never jump to a ledger prior to the latest fully-valid ledger
* Drop validations with signing times too far in the future immediately
This commit is contained in:
JoelKatz
2015-11-18 14:15:04 -08:00
committed by Nik Bougalis
parent 469d5494ea
commit 45b07ff9ec
12 changed files with 77 additions and 51 deletions

View File

@@ -28,7 +28,6 @@ namespace ripple {
STValidation::STValidation (SerialIter& sit, bool checkSignature)
: STObject (getFormat (), sit, sfValidation)
, mTrusted (false)
{
mNodeID = RippleAddress::createNodePublic (getFieldVL (sfSigningPubKey)).getNodeID ();
assert (mNodeID.isNonZero ());
@@ -44,7 +43,7 @@ STValidation::STValidation (
uint256 const& ledgerHash, std::uint32_t signTime,
RippleAddress const& raPub, bool isFull)
: STObject (getFormat (), sfValidation)
, mTrusted (false)
, mSeen (signTime)
{
// Does not sign
setFieldH256 (sfLedgerHash, ledgerHash);
@@ -85,6 +84,11 @@ std::uint32_t STValidation::getSignTime () const
return getFieldU32 (sfSigningTime);
}
std::uint32_t STValidation::getSeenTime () const
{
return mSeen;
}
std::uint32_t STValidation::getFlags () const
{
return getFieldU32 (sfFlags);