PPCoin: Replace RPC command 'setcheckpointkey' with option '-checkpointkey'
[novacoin.git] / src / init.cpp
index 8635ace..62b6103 100644 (file)
@@ -10,6 +10,7 @@
 #include "init.h"
 #include "util.h"
 #include "ui_interface.h"
+#include "checkpoints.h"
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/filesystem/convenience.hpp>
@@ -595,6 +596,12 @@ bool AppInit2(int argc, char* argv[])
         }
     }
 
+    if (mapArgs.count("-checkpointkey")) // ppcoin: checkpoint master priv key
+    {
+        if (!Checkpoints::SetCheckpointPrivKey(GetArg("-checkpointkey", "")))
+            ThreadSafeMessageBox(_("Unable to sign checkpoint, wrong checkpointkey?\n"), _("PPCoin"), wxOK | wxMODAL);
+    }
+
     //
     // Start the node
     //