mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-08 11:16:51 +00:00
closing time. Keep only the validation with the most recent signing time. Sign using network time. This eliminates the ValidationPair nightmare and makes the logic must easier to understand, increasing confidence that it does what it's supposed to do.
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#ifndef __VALIDATION__
|
|
#define __VALIDATION__
|
|
|
|
#include "SerializedObject.h"
|
|
#include "NewcoinAddress.h"
|
|
|
|
class SerializedValidation : public STObject
|
|
{
|
|
protected:
|
|
STVariableLength mSignature;
|
|
bool mTrusted;
|
|
|
|
void setNode();
|
|
|
|
public:
|
|
typedef boost::shared_ptr<SerializedValidation> pointer;
|
|
typedef const boost::shared_ptr<SerializedValidation>& ref;
|
|
|
|
static SOElement sValidationFormat[16];
|
|
static const uint32 sFullFlag;
|
|
|
|
// These throw if the object is not valid
|
|
SerializedValidation(SerializerIterator& sit, bool checkSignature = true);
|
|
SerializedValidation(const Serializer& s, bool checkSignature = true);
|
|
|
|
SerializedValidation(const uint256& ledgerHash, uint32 signTime, const NewcoinAddress& naSeed, bool isFull);
|
|
|
|
uint256 getLedgerHash() const;
|
|
uint32 getSignTime() const;
|
|
uint32 getFlags() const;
|
|
NewcoinAddress getSignerPublic() const;
|
|
bool isValid() const;
|
|
bool isFull() const;
|
|
bool isTrusted() const { return mTrusted; }
|
|
uint256 getSigningHash() const;
|
|
bool isValid(const uint256&) const;
|
|
|
|
void setTrusted() { mTrusted = true; }
|
|
void addSigned(Serializer&) const;
|
|
void addSignature(Serializer&) const;
|
|
std::vector<unsigned char> getSigned() const;
|
|
std::vector<unsigned char> getSignature() const;
|
|
};
|
|
|
|
#endif
|
|
// vim:ts=4
|