2015-03-16 20:44:16 +01:00
|
|
|
|
2016-12-20 14:26:45 +01:00
|
|
|
// Copyright (c) 2014-2017 The Dash Core developers
|
2014-12-06 20:41:53 +01:00
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef SRC_MASTERNODECONFIG_H_
|
|
|
|
#define SRC_MASTERNODECONFIG_H_
|
|
|
|
|
|
|
|
class CMasternodeConfig;
|
|
|
|
extern CMasternodeConfig masternodeConfig;
|
|
|
|
|
|
|
|
class CMasternodeConfig
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2015-03-16 20:44:16 +01:00
|
|
|
|
|
|
|
class CMasternodeEntry {
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string alias;
|
|
|
|
std::string ip;
|
|
|
|
std::string privKey;
|
|
|
|
std::string txHash;
|
|
|
|
std::string outputIndex;
|
|
|
|
public:
|
|
|
|
|
2018-02-12 13:49:00 +01:00
|
|
|
CMasternodeEntry(const std::string& alias, const std::string& ip, const std::string& privKey, const std::string& txHash, const std::string& outputIndex) {
|
2015-03-16 20:44:16 +01:00
|
|
|
this->alias = alias;
|
|
|
|
this->ip = ip;
|
|
|
|
this->privKey = privKey;
|
|
|
|
this->txHash = txHash;
|
|
|
|
this->outputIndex = outputIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getAlias() const {
|
|
|
|
return alias;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getOutputIndex() const {
|
|
|
|
return outputIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getPrivKey() const {
|
|
|
|
return privKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getTxHash() const {
|
|
|
|
return txHash;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getIp() const {
|
|
|
|
return ip;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
CMasternodeConfig() {
|
|
|
|
entries = std::vector<CMasternodeEntry>();
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear();
|
2018-02-12 13:49:00 +01:00
|
|
|
bool read(std::string& strErrRet);
|
|
|
|
void add(const std::string& alias, const std::string& ip, const std::string& privKey, const std::string& txHash, const std::string& outputIndex);
|
2014-12-06 20:41:53 +01:00
|
|
|
|
2015-03-16 20:44:16 +01:00
|
|
|
std::vector<CMasternodeEntry>& getEntries() {
|
|
|
|
return entries;
|
|
|
|
}
|
2014-12-06 20:41:53 +01:00
|
|
|
|
2015-07-16 12:00:16 +02:00
|
|
|
int getCount() {
|
2016-02-02 16:28:56 +01:00
|
|
|
return (int)entries.size();
|
2015-07-16 12:00:16 +02:00
|
|
|
}
|
|
|
|
|
2014-12-06 20:41:53 +01:00
|
|
|
private:
|
2015-03-16 20:44:16 +01:00
|
|
|
std::vector<CMasternodeEntry> entries;
|
2014-12-06 20:41:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SRC_MASTERNODECONFIG_H_ */
|