PPCoin: Fix checkwallet/repairwallet since 7237fa0 and c9d6552
[novacoin.git] / src / bitcoinrpc.cpp
index 50299cc..e469e4e 100644 (file)
@@ -2105,14 +2105,15 @@ Value checkwallet(const Array& params, bool fHelp)
 
     int nMismatchSpent;
     int64 nBalanceInQuestion;
-    if (!pwalletMain->CheckSpentCoins(nMismatchSpent, nBalanceInQuestion))
+    Object result;
+    if (pwalletMain->CheckSpentCoins(nMismatchSpent, nBalanceInQuestion))
+        result.push_back(Pair("wallet check passed", true));
+    else
     {
-        Object result;
         result.push_back(Pair("mismatched spent coins", nMismatchSpent));
         result.push_back(Pair("amount in question", ValueFromAmount(nBalanceInQuestion)));
-        return result;
     }
-    return Value::null;
+    return result;
 }
 
 
@@ -2129,9 +2130,7 @@ Value repairwallet(const Array& params, bool fHelp)
     pwalletMain->FixSpentCoins(nMismatchSpent, nBalanceInQuestion);
     Object result;
     if (nMismatchSpent == 0)
-    {
         result.push_back(Pair("wallet check passed", true));
-    }
     else
     {
         result.push_back(Pair("mismatched spent coins", nMismatchSpent));