Files
rippled/src/SerializedValidation.h
JoelKatz 4930ebb945 Simplify the way we handle validations. Include a signing time instead of a
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.
2012-09-03 20:13:57 -07:00

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