Fix remote-activation hanging issue

- Clients that were waiting for remote activation were repeatidly checking their wallet and external address. This will make them skip that check if the wallet is empty, then be remotely activated by mnb.
This commit is contained in:
Evan Duffield 2015-08-23 18:14:32 -07:00
parent 0002fd1d6e
commit a0f9355946

View File

@ -42,6 +42,18 @@ void CActiveMasternode::ManageStatus()
status = ACTIVE_MASTERNODE_NOT_CAPABLE;
notCapableReason = "";
if(pwalletMain->IsLocked()){
notCapableReason = "Wallet is locked.";
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason);
return;
}
if(pwalletMain->GetBalance() == 0){
notCapableReason = "Hot node, waiting for remote activation.";
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason);
return;
}
if(strMasterNodeAddr.empty()) {
if(!GetLocal(service)) {
notCapableReason = "Can't detect external address. Please use the masternodeaddr configuration option.";
@ -72,13 +84,6 @@ void CActiveMasternode::ManageStatus()
return;
}
if(pwalletMain->IsLocked()){
notCapableReason = "Wallet is locked.";
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason);
return;
}
// Choose coins to use
CPubKey pubKeyCollateralAddress;
CKey keyCollateralAddress;