X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcwallet.cpp;h=3f03145e1e96f941868d73192ec7d290a1b0fe22;hb=1c4fc9052a444c114d9c1501d2c6d1305de650d0;hp=5699c4ff193188f88208e10c68174ec3a5451dbc;hpb=5249b8a7060b3f59bdf4c710cfc20a99d3c164e9;p=novacoin.git diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 5699c4f..3f03145 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -69,15 +69,12 @@ Value getinfo(const Array& params, bool fHelp) proxyType proxy; GetProxy(NET_IPV4, proxy); - int64 nTotal = 0, nWatchOnly = 0; - pwalletMain->GetBalance(nTotal, nWatchOnly); - Object obj, diff; obj.push_back(Pair("version", FormatFullVersion())); obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); - obj.push_back(Pair("balance", ValueFromAmount(nTotal))); - obj.push_back(Pair("unspendable", ValueFromAmount(nWatchOnly))); + obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); + obj.push_back(Pair("unspendable", ValueFromAmount(pwalletMain->GetBalanceWatchOnly()))); obj.push_back(Pair("newmint", ValueFromAmount(pwalletMain->GetNewMint()))); obj.push_back(Pair("stake", ValueFromAmount(pwalletMain->GetStake()))); obj.push_back(Pair("blocks", (int)nBestHeight)); @@ -726,9 +723,7 @@ Value sendmany(const Array& params, bool fHelp) bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired); if (!fCreated) { - int64 nTotal = 0, nWatchOnly = 0; - pwalletMain->GetBalance(nTotal, nWatchOnly); - + int64 nTotal = pwalletMain->GetBalance(), nWatchOnly = pwalletMain->GetBalanceWatchOnly(); if (totalAmount + nFeeRequired > nTotal - nWatchOnly) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds"); throw JSONRPCError(RPC_WALLET_ERROR, "Transaction creation failed"); @@ -1265,7 +1260,7 @@ Value gettransaction(const Array& params, bool fHelp) TxToJSON(wtx, 0, entry); - int64 nCredit = wtx.GetCredit(false); + int64 nCredit = wtx.GetCredit(); int64 nDebit = wtx.GetDebit(); int64 nNet = nCredit - nDebit; int64 nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);