mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
We have to track the high node ID of trusted validators as a tie-breaker.
1) Change return from getCurrentValidations 2) Log tiebreaker logic to aid debugging 3) Change checkLastClosedLedger to use the new tie-breaker logic 4) Log when we refuse to switch to our own previous ledger 5) Track node ID in the serialized validation object 6) Simplify getCurrentValidations ledger suppression logic
This commit is contained in:
@@ -27,6 +27,8 @@ const uint32 SerializedValidation::sFullFlag = 0x1;
|
||||
SerializedValidation::SerializedValidation(SerializerIterator& sit, bool checkSignature)
|
||||
: STObject(sValidationFormat, sit, sfValidation), mTrusted(false)
|
||||
{
|
||||
mNodeID = NewcoinAddress::createNodePublic(getFieldVL(sfSigningPubKey)).getNodeID();
|
||||
assert(mNodeID.isNonZero());
|
||||
if (checkSignature && !isValid())
|
||||
{
|
||||
Log(lsTRACE) << "Invalid validation " << getJson(0);
|
||||
@@ -41,7 +43,12 @@ SerializedValidation::SerializedValidation(const uint256& ledgerHash, uint32 sig
|
||||
setFieldH256(sfLedgerHash, ledgerHash);
|
||||
setFieldU32(sfSigningTime, signTime);
|
||||
if (naSeed.isValid())
|
||||
setFieldVL(sfSigningPubKey, NewcoinAddress::createNodePublic(naSeed).getNodePublic());
|
||||
{
|
||||
NewcoinAddress np = NewcoinAddress::createNodePublic(naSeed);
|
||||
setFieldVL(sfSigningPubKey, np.getNodePublic());
|
||||
mNodeID = np.getNodeID();
|
||||
assert(mNodeID.isNonZero());
|
||||
}
|
||||
if (!isFull)
|
||||
setFlag(sFullFlag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user