2015-03-16 20:44:16 +01:00
|
|
|
|
2015-03-18 00:06:58 +01:00
|
|
|
// Copyright (c) 2014-2015 The Dash 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_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
#include <boost/filesystem/fstream.hpp>
|
|
|
|
|
|
|
|
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;
|
|
|
|
std::string donationAddress;
|
|
|
|
std::string donationPercent;
|
|
|
|
public:
|
|
|
|
|
|
|
|
CMasternodeEntry(std::string alias, std::string ip, std::string privKey, std::string txHash, std::string outputIndex, std::string donationAddress, std::string donationPercent) {
|
|
|
|
this->alias = alias;
|
|
|
|
this->ip = ip;
|
|
|
|
this->privKey = privKey;
|
|
|
|
this->txHash = txHash;
|
|
|
|
this->outputIndex = outputIndex;
|
|
|
|
this->donationAddress = donationAddress;
|
|
|
|
this->donationPercent = donationPercent;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getAlias() const {
|
|
|
|
return alias;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setAlias(const std::string& alias) {
|
|
|
|
this->alias = alias;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getOutputIndex() const {
|
|
|
|
return outputIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setOutputIndex(const std::string& outputIndex) {
|
|
|
|
this->outputIndex = outputIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getPrivKey() const {
|
|
|
|
return privKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setPrivKey(const std::string& privKey) {
|
|
|
|
this->privKey = privKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getTxHash() const {
|
|
|
|
return txHash;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setTxHash(const std::string& txHash) {
|
|
|
|
this->txHash = txHash;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getIp() const {
|
|
|
|
return ip;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setIp(const std::string& ip) {
|
|
|
|
this->ip = ip;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getDonationAddress() const {
|
|
|
|
return donationAddress;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getDonationPercentage() const {
|
|
|
|
return donationPercent;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
CMasternodeConfig() {
|
|
|
|
entries = std::vector<CMasternodeEntry>();
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear();
|
2015-01-11 18:28:28 +01:00
|
|
|
bool read(std::string& strErr);
|
2015-03-16 20:44:16 +01:00
|
|
|
void add(std::string alias, std::string ip, std::string privKey, std::string txHash, std::string outputIndex, std::string donationAddress, std::string donationPercent);
|
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
|
|
|
|
|
|
|
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_ */
|