#include "checkpoints.h"
#include "main.h"
#include "txdb-leveldb.h"
-#include "uint256.h"
#include <algorithm>
std::string CSyncCheckpoint::strMasterPrivKey = "";
// ppcoin: verify signature of sync-checkpoint message
+CSyncCheckpoint::CSyncCheckpoint()
+{
+ SetNull();
+}
+
+void CSyncCheckpoint::SetNull()
+{
+ CUnsignedSyncCheckpoint::SetNull();
+ vchMsg.clear();
+ vchSig.clear();
+}
+
+bool CSyncCheckpoint::IsNull() const
+{
+ return (hashCheckpoint == 0);
+}
+
+uint256 CSyncCheckpoint::GetHash() const
+{
+ return SerializeHash(*this);
+}
+
+bool CSyncCheckpoint::RelayTo(CNode *pnode) const
+{
+ // returns true if wasn't already sent
+ if (pnode->hashCheckpointKnown != hashCheckpoint)
+ {
+ pnode->hashCheckpointKnown = hashCheckpoint;
+ pnode->PushMessage("checkpoint", *this);
+ return true;
+ }
+ return false;
+}
+
bool CSyncCheckpoint::CheckSignature()
{
CPubKey key(ParseHex(CSyncCheckpoint::strMasterPubKey));