Merge pull request #470 from UdjinM6/v0.12.0.x_fix_rpc_darksend_lock

V0.12.0.x fix rpc for darksend
This commit is contained in:
evan82 2015-08-03 13:16:56 -07:00
commit cc4b40616f
2 changed files with 10 additions and 5 deletions

View File

@ -445,7 +445,7 @@ std::string CDarksendPool::GetStatus()
showingDarkSendMessage += 10;
std::string suffix = "";
if(chainActive.Tip()->nHeight - cachedLastSuccess < minBlockSpacing) {
if(chainActive.Tip()->nHeight - cachedLastSuccess < minBlockSpacing || !masternodeSync.IsBlockchainSynced()) {
return strAutoDenomResult;
}
switch(state) {
@ -1352,6 +1352,12 @@ void CDarksendPool::ClearLastMessage()
//
bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
{
TRY_LOCK(cs_darksend, lockDS);
if(!lockDS) {
strAutoDenomResult = _("Lock is already in place.");
return false;
}
LOCK(cs_darksend);
if(!masternodeSync.IsBlockchainSynced()) {

View File

@ -57,7 +57,7 @@ Value darksend(const Array& params, bool fHelp)
throw runtime_error(
"darksend <dashaddress> <amount>\n"
"dashaddress, reset, or auto (AutoDenominate)"
"<amount> is a real and is rounded to the nearest 0.00000001"
"<amount> is a real and will be rounded to the next 0.1"
+ HelpRequiringPassphrase());
if (pwalletMain->IsLocked())
@ -67,8 +67,7 @@ Value darksend(const Array& params, bool fHelp)
if(fMasterNode)
return "DarkSend is not supported from masternodes";
darkSendPool.DoAutomaticDenominating();
return "DoAutomaticDenominating";
return "DoAutomaticDenominating " + (darkSendPool.DoAutomaticDenominating() ? "successful" : ("failed: " + darkSendPool.GetStatus()));
}
if(params[0].get_str() == "reset"){
@ -80,7 +79,7 @@ Value darksend(const Array& params, bool fHelp)
throw runtime_error(
"darksend <dashaddress> <amount>\n"
"dashaddress, denominate, or auto (AutoDenominate)"
"<amount> is a real and is rounded to the nearest 0.00000001"
"<amount> is a real and will be rounded to the next 0.1"
+ HelpRequiringPassphrase());
CBitcoinAddress address(params[0].get_str());