1-
21// Copyright (c) 2009-2010 Satoshi Nakamoto
32// Copyright (c) 2009-2012 The Bitcoin developers
43// Distributed under the MIT/X11 software license, see the accompanying
@@ -21,36 +20,45 @@ extern CActiveMasternode activeMasternode;
2120class CActiveMasternode
2221{
2322public:
24- CTxIn vinMasternode;
25- CPubKey pubkeyMasterNode;
26- CPubKey pubkeyMasterNode2;
27-
28- std::string strMasterNodeSignMessage;
29- std::vector<unsigned char > vchMasterNodeSignature;
23+ // Initialized by init.cpp
24+ // Keys for the main masternode
25+ CPubKey pubKeyMasternode;
3026
31- std::string masterNodeAddr;
32- CService masterNodeSignAddr;
27+ // Initialized while registering masternode
28+ CTxIn vin;
29+ CService service;
3330
34- int isCapableMasterNode;
35- int64 masterNodeSignatureTime;
36- int masternodePortOpen;
31+ int status;
32+ std::string notCapableReason;
3733
3834 CActiveMasternode ()
3935 {
40- isCapableMasterNode = MASTERNODE_NOT_PROCESSED;
41- masternodePortOpen = 0 ;
36+ status = MASTERNODE_NOT_PROCESSED;
4237 }
4338
39+ void ManageStatus (); // manage status of main masternode
40+
41+ bool Dseep (std::string& errorMessage); // ping for main masternode
42+ bool Dseep (CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string &retErrorMessage, bool stop); // ping for any masternode
43+
44+ bool StopMasterNode (std::string& errorMessage); // stop main masternode
45+ bool StopMasterNode (std::string strService, std::string strKeyMasternode, std::string& errorMessage); // stop remote masternode
46+ bool StopMasterNode (CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string& errorMessage); // stop any masternode
47+
48+ bool Register (std::string strService, std::string strKey, std::string txHash, std::string strOutputIndex, std::string& errorMessage); // register remote masternode
49+ bool Register (CTxIn vin, CService service, CKey key, CPubKey pubKey, CKey keyMasternode, CPubKey pubKeyMasternode, std::string &retErrorMessage); // register any masternode
50+
4451 // get 1000DRK input that can be used for the masternode
4552 bool GetMasterNodeVin (CTxIn& vin, CPubKey& pubkey, CKey& secretKey);
53+ bool GetMasterNodeVin (CTxIn& vin, CPubKey& pubkey, CKey& secretKey, std::string strTxHash, std::string strOutputIndex);
54+ vector<COutput> SelectCoinsMasternode ();
55+ bool GetVinFromOutput (COutput out, CTxIn& vin, CPubKey& pubkey, CKey& secretKey);
4656
47- // start the masternode and register with the network
48- void RegisterAsMasterNode (bool stop);
49- // start a remote masternode
50- bool RegisterAsMasterNodeRemoteOnly (std::string strMasterNodeAddr, std::string strMasterNodePrivKey);
57+ // bool SelectCoinsMasternode(CTxIn& vin, int64& nValueIn, CScript& pubScript, std::string strTxHash, std::string strOutputIndex);
5158
5259 // enable hot wallet mode (run a masternode with no funds)
53- bool EnableHotColdMasterNode (CTxIn& vin, int64 sigTime, CService& addr);
60+ bool EnableHotColdMasterNode (CTxIn& vin, CService& addr);
61+
5462};
5563
56- #endif
64+ #endif
0 commit comments