#ifndef __VALIDATION__ #define __VALIDATION__ #include "SerializedObject.h" #include "NewcoinAddress.h" class SerializedValidation : public STObject { protected: STVariableLength mSignature; uint256 mPreviousHash; bool mTrusted; void setNode(); public: typedef boost::shared_ptr pointer; typedef const boost::shared_ptr& ref; 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 getSigned() const; std::vector getSignature() const; // The validation this replaced const uint256& getPreviousHash() { return mPreviousHash; } bool isPreviousHash(const uint256& h) { return mPreviousHash == h; } void setPreviousHash(const uint256& h) { mPreviousHash = h; } }; #endif // vim:ts=4