PRCYCoin  2.0.0.7rc1
P2P Digital Currency
activemasternode.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2016 The Dash developers
2 // Copyright (c) 2015-2018 The PIVX developers
3 // Copyright (c) 2018-2020 The DAPS Project developers
4 // Distributed under the MIT/X11 software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #ifndef ACTIVEMASTERNODE_H
8 #define ACTIVEMASTERNODE_H
9 
10 #include "init.h"
11 #include "key.h"
12 #include "masternode.h"
13 #include "net.h"
14 #include "sync.h"
15 #include "wallet/wallet.h"
16 
17 #define ACTIVE_MASTERNODE_INITIAL 0 // initial state
18 #define ACTIVE_MASTERNODE_SYNC_IN_PROCESS 1
19 #define ACTIVE_MASTERNODE_NOT_CAPABLE 3
20 #define ACTIVE_MASTERNODE_STARTED 4
21 
22 // Responsible for activating the Masternode and pinging the network
24 {
25 private:
27  bool SendMasternodePing(std::string& errorMessage);
28 
29  int status;
30  std::string notCapableReason;
31 
32 public:
33 
35  {
37  }
38 
39  // Initialized by init.cpp
40  // Keys for the main Masternode
42 
43  // Initialized while registering Masternode
46 
48  void ManageStatus();
49  void ResetStatus();
50  std::string GetStatusMessage() const;
51  int GetStatus() const { return status; }
52 
55 };
56 
57 #endif
CTxIn
An input of a transaction.
Definition: transaction.h:83
CActiveMasternode::EnableHotColdMasterNode
bool EnableHotColdMasterNode(CTxIn &vin, CService &addr)
Enable cold wallet mode (run a Masternode with no funds)
Definition: activemasternode.cpp:162
CService
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:133
CActiveMasternode::ResetStatus
void ResetStatus()
Definition: activemasternode.cpp:89
CActiveMasternode
Definition: activemasternode.h:23
CActiveMasternode::notCapableReason
std::string notCapableReason
Definition: activemasternode.h:30
sync.h
CActiveMasternode::vin
CTxIn vin
Definition: activemasternode.h:44
wallet.h
CActiveMasternode::pubKeyMasternode
CPubKey pubKeyMasternode
Definition: activemasternode.h:41
CActiveMasternode::ManageStatus
void ManageStatus()
Manage status of main Masternode.
Definition: activemasternode.cpp:21
init.h
CActiveMasternode::GetStatusMessage
std::string GetStatusMessage() const
Definition: activemasternode.cpp:95
CActiveMasternode::CActiveMasternode
CActiveMasternode()
Definition: activemasternode.h:34
key.h
CPubKey
An encapsulated public key.
Definition: pubkey.h:37
CActiveMasternode::service
CService service
Definition: activemasternode.h:45
masternode.h
ACTIVE_MASTERNODE_INITIAL
#define ACTIVE_MASTERNODE_INITIAL
Definition: activemasternode.h:17
CActiveMasternode::GetStatus
int GetStatus() const
Definition: activemasternode.h:51
net.h
CActiveMasternode::status
int status
Definition: activemasternode.h:29
CActiveMasternode::SendMasternodePing
bool SendMasternodePing(std::string &errorMessage)
Ping Masternode.
Definition: activemasternode.cpp:111