Rpc changes for missing masternodes:
- show MN status in `masternode list-conf`, display MISSING if MN was not found in mn list - do not allow to run `start-missing` and `start-disabled` until mn list is synced
This commit is contained in:
parent
2c14877c6e
commit
dcf020a886
@ -342,6 +342,12 @@ Value masternode(const Array& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((strCommand == "start-missing" || strCommand == "start-disabled") &&
|
||||||
|
(masternodeSync.RequestedMasternodeAssets <= MASTERNODE_SYNC_LIST ||
|
||||||
|
masternodeSync.RequestedMasternodeAssets == MASTERNODE_SYNC_FAILED)) {
|
||||||
|
throw runtime_error("You can't use this command until masternode list is synced\n");
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<CMasternodeConfig::CMasternodeEntry> mnEntries;
|
std::vector<CMasternodeConfig::CMasternodeEntry> mnEntries;
|
||||||
mnEntries = masternodeConfig.getEntries();
|
mnEntries = masternodeConfig.getEntries();
|
||||||
|
|
||||||
@ -405,12 +411,18 @@ Value masternode(const Array& params, bool fHelp)
|
|||||||
Object resultObj;
|
Object resultObj;
|
||||||
|
|
||||||
BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) {
|
BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) {
|
||||||
|
CTxIn vin = CTxIn(uint256(mne.getTxHash()), uint32_t(atoi(mne.getOutputIndex().c_str())));
|
||||||
|
CMasternode *pmn = mnodeman.Find(vin);
|
||||||
|
|
||||||
|
std::string strStatus = pmn ? pmn->Status() : "MISSING";
|
||||||
|
|
||||||
Object mnObj;
|
Object mnObj;
|
||||||
mnObj.push_back(Pair("alias", mne.getAlias()));
|
mnObj.push_back(Pair("alias", mne.getAlias()));
|
||||||
mnObj.push_back(Pair("address", mne.getIp()));
|
mnObj.push_back(Pair("address", mne.getIp()));
|
||||||
mnObj.push_back(Pair("privateKey", mne.getPrivKey()));
|
mnObj.push_back(Pair("privateKey", mne.getPrivKey()));
|
||||||
mnObj.push_back(Pair("txHash", mne.getTxHash()));
|
mnObj.push_back(Pair("txHash", mne.getTxHash()));
|
||||||
mnObj.push_back(Pair("outputIndex", mne.getOutputIndex()));
|
mnObj.push_back(Pair("outputIndex", mne.getOutputIndex()));
|
||||||
|
mnObj.push_back(Pair("status", strStatus));
|
||||||
resultObj.push_back(Pair("masternode", mnObj));
|
resultObj.push_back(Pair("masternode", mnObj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user