X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpc.cpp;h=8a02d95c1b3e9d7b691971a05cbb506bdb70914a;hb=ef2f3ddaf764f886fbb4d6004844fe88b8029cf2;hp=b62da8ecdf051a2d10a06387f3254b681aa38600;hpb=e88b6b341d75536f2743ce735c338c9fe93ba272;p=novacoin.git diff --git a/src/rpc.cpp b/src/rpc.cpp index b62da8e..8a02d95 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -147,7 +147,7 @@ Value help(const Array& params, bool fHelp) // Help text is returned in an exception string strHelp = string(e.what()); if (strCommand == "") - if (strHelp.find('\n') != -1) + if (strHelp.find('\n') != string::npos) strHelp = strHelp.substr(0, strHelp.find('\n')); strRet += strHelp + "\n"; } @@ -685,8 +685,10 @@ Value getbalance(const Array& params, bool fHelp) list > listSent; wtx.GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount); if (wtx.GetDepthInMainChain() >= nMinDepth) + { BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listReceived) nBalance += r.second; + } BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress,int64)& r, listSent) nBalance -= r.second; nBalance -= allFee; @@ -1046,6 +1048,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe // Received if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth) + { BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, int64)& r, listReceived) { string account; @@ -1063,6 +1066,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe ret.push_back(entry); } } + } } void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Array& ret)