30 #define DEFAULT_SENTINEL_VERSION 0x010001 49 template <
typename Stream,
typename Operation>
50 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
55 if(ser_action.ForRead() && (s.size() == 0))
104 int64_t tWatchdogV = 0) :
176 template <
typename Stream,
typename Operation>
177 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
208 void Check(
bool fForce =
false);
216 if(nTimeToCheckAt == -1) {
322 CMasternode(addrNew, outpointNew, pubKeyCollateralAddressNew, pubKeyMasternodeNew, nProtocolVersionIn),
fRecovery(false) {}
326 template <
typename Stream,
typename Operation>
327 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
349 static bool Create(std::string strService, std::string strKey, std::string strTxHash, std::string strOutputIndex, std::string& strErrorRet,
CMasternodeBroadcast &mnbRet,
bool fOffline =
false);
355 bool Sign(
const CKey& keyCollateralAddress);
381 template <
typename Stream,
typename Operation>
382 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
bool CheckOutpoint(int &nDos)
uint32_t nSentinelVersion
bool Update(CMasternode *pmn, int &nDos, CConnman &connman)
void UpdateWatchdogVoteTime(uint64_t nVoteTime=0)
void Relay(CConnman &connman)
bool UpdateFromNewBroadcast(CMasternodeBroadcast &mnb, CConnman &connman)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool SimpleCheck(int &nDos)
int64_t nTimeLastWatchdogVote
masternode_info_t(int activeState, int protoVer, int64_t sTime, COutPoint const &outpoint, CService const &addr, CPubKey const &pkCollAddr, CPubKey const &pkMN, int64_t tWatchdogV=0)
std::vector< unsigned char > vchSig
bool CheckAndUpdate(CMasternode *pmn, bool fFromNewBroadcast, int &nDos, CConnman &connman)
void FlagGovernanceItemsAsDirty()
bool Sign(const CKey &keyCollateralAddress)
static const int MASTERNODE_NEW_START_REQUIRED_SECONDS
masternode_info_t()=default
#define DEFAULT_SENTINEL_VERSION
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::vector< unsigned char > vchSig
static const int MASTERNODE_WATCHDOG_MAX_SECONDS
std::vector< unsigned char > vchSig1
bool IsBroadcastedWithin(int nSeconds)
static CollateralStatus CheckCollateral(const COutPoint &outpoint)
std::map< uint256, int > mapGovernanceObjectsVotedOn
std::string GetStateString() const
bool IsInputAssociatedWithPubkey()
Is the input associated with collateral public key? (and there is 1000 DASH - checking if valid maste...
static const int MASTERNODE_MIN_MNB_SECONDS
std::string GetStatus() const
bool Sign(const CKey &keyMasternode, const CPubKey &pubKeyMasternode)
static const int MASTERNODE_CHECK_SECONDS
arith_uint256 CalculateScore(const uint256 &blockHash)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
CMasternodePing()=default
bool operator==(const CMasternodePing &a, const CMasternodePing &b)
static bool Create(const COutPoint &outpoint, const CService &service, const CKey &keyCollateralAddressNew, const CPubKey &pubKeyCollateralAddressNew, const CKey &keyMasternodeNew, const CPubKey &pubKeyMasternodeNew, std::string &strErrorRet, CMasternodeBroadcast &mnbRet)
Create Masternode broadcast, needs to be relayed manually after that.
CMasternodeBroadcast(CService addrNew, COutPoint outpointNew, CPubKey pubKeyCollateralAddressNew, CPubKey pubKeyMasternodeNew, int nProtocolVersionIn)
void RemoveGovernanceObject(uint256 nGovernanceObjectHash)
bool operator!=(const CMasternodePing &a, const CMasternodePing &b)
void UpdateLastPaid(const CBlockIndex *pindex, int nMaxBlocksToScanBack)
void Check(bool fForce=false)
bool CheckSignature(CPubKey &pubKeyMasternode, int &nDos)
static const int MASTERNODE_MIN_MNP_SECONDS
CMasternodeBroadcast(const CMasternode &mn)
CSporkManager sporkManager
static const int SPORK_14_REQUIRE_SENTINEL_FLAG
bool IsNewStartRequired()
std::vector< unsigned char > vchSig2
void AddGovernanceVote(uint256 nGovernanceObjectHash)
CPubKey pubKeyCollateralAddress
static const int MASTERNODE_EXPIRATION_SECONDS
static const int MASTERNODE_POSE_BAN_MAX_SCORE
bool CheckSignature(int &nDos)
static const int PROTOCOL_VERSION
static std::string StateToString(int nStateIn)
int64_t GetAdjustedTime()
void IncreasePoSeBanScore()
masternode_info_t(int activeState, int protoVer, int64_t sTime)
static bool IsValidStateForAutoStart(int nActiveStateIn)
std::unique_ptr< CConnman > g_connman
bool SimpleCheck(int &nDos)
masternode_info_t GetInfo()
bool IsSporkActive(int nSporkID)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
void Relay(CConnman &connman)
CMasternodeVerification()=default
void DecreasePoSeBanScore()
uint256 nCollateralMinConfBlockHash
CMasternodeVerification(CService addr, int nonce, int nBlockHeight)
CMasternode & operator=(CMasternode const &from)
bool IsPingedWithin(int nSeconds, int64_t nTimeToCheckAt=-1)