Use ledger hash to break ties (RIPD-1468):

When two ledgers have the same number of validations, the code
will now use the ledger hash itself to break the tie rather than
the highest node ID supporting each validation.
This commit is contained in:
Brad Chase
2017-05-11 15:42:29 -04:00
committed by Nik Bougalis
parent 9ae717c433
commit 60dd194b72
6 changed files with 112 additions and 205 deletions

View File

@@ -100,26 +100,11 @@ public:
// Signs the validation and returns the signing hash
uint256 sign (SecretKey const& secretKey);
// The validation this replaced
uint256 const& getPreviousHash ()
{
return mPreviousHash;
}
bool isPreviousHash (uint256 const& h) const
{
return mPreviousHash == h;
}
void setPreviousHash (uint256 const& h)
{
mPreviousHash = h;
}
private:
static SOTemplate const& getFormat ();
void setNode ();
uint256 mPreviousHash;
NodeID mNodeID;
bool mTrusted = false;
NetClock::time_point mSeen = {};