mirror of
https://github.com/dashpay/dash.git
synced 2024-12-30 14:25:53 +01:00
55cae78c3b
- refactored CActiveMasternode - added masternodeconfig to handle remote masternode configuration - read masternodeconfig upon init - new masternode rpc commands: stop-many, start-alias, stop-alias, list-conf - added notCapableReason field for better handling not capable issues
62 lines
2.4 KiB
C++
62 lines
2.4 KiB
C++
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
// Copyright (c) 2009-2012 The Bitcoin developers
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
#ifndef ACTIVEMASTERNODE_H
|
|
#define ACTIVEMASTERNODE_H
|
|
|
|
#include "bignum.h"
|
|
#include "sync.h"
|
|
#include "net.h"
|
|
#include "key.h"
|
|
#include "core.h"
|
|
#include "init.h"
|
|
#include "wallet.h"
|
|
#include "darksend.h"
|
|
|
|
// Responsible for activating the masternode and pinging the network
|
|
class CActiveMasternode
|
|
{
|
|
public:
|
|
// Initialized by init.cpp
|
|
// Keys for the main masternode
|
|
CPubKey pubKeyMasternode;
|
|
|
|
// Initialized while registering masternode
|
|
CTxIn vin;
|
|
CService service;
|
|
|
|
int status;
|
|
std::string notCapableReason;
|
|
|
|
CActiveMasternode()
|
|
{
|
|
status = MASTERNODE_NOT_PROCESSED;
|
|
}
|
|
|
|
void ManageStatus(); // manage status of main masternode
|
|
|
|
bool Dseep(std::string& errorMessage); // ping for main masternode
|
|
bool Dseep(CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string &retErrorMessage, bool stop); // ping for any masternode
|
|
|
|
bool StopMasterNode(std::string& errorMessage); // stop main masternode
|
|
bool StopMasterNode(std::string strService, std::string strKeyMasternode, std::string& errorMessage); // stop remote masternode
|
|
bool StopMasterNode(CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string& errorMessage); // stop any masternode
|
|
|
|
bool Register(std::string strService, std::string strKey, std::string txHash, std::string strOutputIndex, std::string& errorMessage); // register remote masternode
|
|
bool Register(CTxIn vin, CService service, CKey key, CPubKey pubKey, CKey keyMasternode, CPubKey pubKeyMasternode, std::string &retErrorMessage); // register any masternode
|
|
|
|
// get 1000DRK input that can be used for the masternode
|
|
bool GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey);
|
|
bool GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey, std::string strTxHash, std::string strOutputIndex);
|
|
vector<COutput> SelectCoinsMasternode();
|
|
bool GetVinFromOutput(COutput out, CTxIn& vin, CPubKey& pubkey, CKey& secretKey);
|
|
|
|
//bool SelectCoinsMasternode(CTxIn& vin, int64& nValueIn, CScript& pubScript, std::string strTxHash, std::string strOutputIndex);
|
|
|
|
// enable hot wallet mode (run a masternode with no funds)
|
|
bool EnableHotColdMasterNode(CTxIn& vin, CService& addr);
|
|
};
|
|
|
|
#endif
|