Merge pull request #451 from UdjinM6/v0.12.0.x_fix_rpc

V0.12.0.x small fixes for rpc
This commit is contained in:
evan82 2015-07-23 06:29:33 -07:00
commit 9e879d5e8d
2 changed files with 12 additions and 7 deletions

View File

@ -76,7 +76,7 @@ Value mnbudget(const Array& params, bool fHelp)
int nBlockEnd = nBlockStart + GetBudgetPaymentCycleBlocks() * nPaymentCount;
if(nBlockStart < nBlockMin)
return "Invalid payment count, must be more than current height.";
return "Invalid block start, must be more than current height.";
if(nBlockEnd < pindexPrev->nHeight)
return "Invalid ending block, starting block + (payment_cycle*payments) must be more than current height.";
@ -98,7 +98,11 @@ Value mnbudget(const Array& params, bool fHelp)
return "Proposal is not valid - " + budgetProposalBroadcast.GetHash().ToString() + " - " + strError;
bool useIX = true;
if (params.size() > 7) useIX = params[7].get_bool();
if (params.size() > 7) {
if(params[7].get_str() != "false" && params[7].get_str() != "true")
return "Invalid use_ix, must be true or false";
useIX = params[7].get_str() == "true" ? true : false;
}
CWalletTx wtx;
pwalletMain->GetBudgetSystemCollateralTX(wtx, budgetProposalBroadcast.GetHash(), useIX);

View File

@ -226,7 +226,8 @@ Value masternode(const Array& params, bool fHelp)
if (strCommand == "debug")
{
if(activeMasternode.status != ACTIVE_MASTERNODE_INITIAL) return activeMasternode.GetStatus();
if(activeMasternode.status != ACTIVE_MASTERNODE_INITIAL || !masternodeSync.IsSynced())
return activeMasternode.GetStatus();
CTxIn vin = CTxIn();
CPubKey pubkey = CScript();
@ -235,7 +236,7 @@ Value masternode(const Array& params, bool fHelp)
if(!found){
return "Missing masternode input, please look at the documentation for instructions on masternode creation";
} else {
return "No problems were found";
return activeMasternode.GetStatus();
}
}
@ -541,9 +542,9 @@ Value masternodelist(const Array& params, bool fHelp)
mn.protocolVersion << " " <<
address2.ToString() << " " << setw(21) <<
mn.addr.ToString() << " " <<
mn.lastPing.sigTime << " " << setw(8) <<
(mn.lastPing.sigTime - mn.sigTime) << " " <<
mn.GetLastPaid();
(int64_t)mn.lastPing.sigTime << " " << setw(8) <<
(int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
(int64_t)mn.GetLastPaid();
std::string output = stringStream.str();
stringStream << " " << strVin;
if(strFilter !="" && stringStream.str().find(strFilter) == string::npos &&