Cut to 32-bit network times.

This commit is contained in:
JoelKatz
2012-07-12 01:41:24 -07:00
parent 34935be1f4
commit ecd47f0ea8
9 changed files with 27 additions and 28 deletions

View File

@@ -6,7 +6,7 @@
SOElement SerializedValidation::sValidationFormat[] = {
{ sfFlags, "Flags", STI_UINT32, SOE_FLAGS, 0 },
{ sfLedgerHash, "LedgerHash", STI_HASH256, SOE_REQUIRED, 0 },
{ sfCloseTime, "CloseTime", STI_UINT64, SOE_REQUIRED, 0 },
{ sfCloseTime, "CloseTime", STI_UINT32, SOE_REQUIRED, 0 },
{ sfSigningKey, "SigningKey", STI_VL, SOE_REQUIRED, 0 },
{ sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 },
};
@@ -19,12 +19,12 @@ SerializedValidation::SerializedValidation(SerializerIterator& sit, bool checkSi
if (checkSignature && !isValid()) throw std::runtime_error("Invalid validation");
}
SerializedValidation::SerializedValidation(const uint256& ledgerHash, uint64 closeTime,
SerializedValidation::SerializedValidation(const uint256& ledgerHash, uint32 closeTime,
const NewcoinAddress& naSeed, bool isFull)
: STObject(sValidationFormat), mSignature("Signature"), mTrusted(false)
{
setValueFieldH256(sfLedgerHash, ledgerHash);
setValueFieldU64(sfCloseTime, closeTime);
setValueFieldU32(sfCloseTime, closeTime);
if (naSeed.isValid())
setValueFieldVL(sfSigningKey, NewcoinAddress::createNodePublic(naSeed).getNodePublic());
if (!isFull) setFlag(sFullFlag);
@@ -50,9 +50,9 @@ uint256 SerializedValidation::getLedgerHash() const
return getValueFieldH256(sfLedgerHash);
}
uint64 SerializedValidation::getCloseTime() const
uint32 SerializedValidation::getCloseTime() const
{
return getValueFieldU64(sfCloseTime);
return getValueFieldU32(sfCloseTime);
}
bool SerializedValidation::isValid() const