mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
removed default argument values for ismine filter
This commit is contained in:
@@ -557,7 +557,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
|
||||
}
|
||||
|
||||
|
||||
int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter = MINE_SPENDABLE)
|
||||
int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth, const isminefilter& filter)
|
||||
{
|
||||
int64_t nBalance = 0;
|
||||
|
||||
@@ -582,7 +582,7 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi
|
||||
return nBalance;
|
||||
}
|
||||
|
||||
int64_t GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter = MINE_SPENDABLE)
|
||||
int64_t GetAccountBalance(const string& strAccount, int nMinDepth, const isminefilter& filter)
|
||||
{
|
||||
CWalletDB walletdb(pwalletMain->strWalletFile);
|
||||
return GetAccountBalance(walletdb, strAccount, nMinDepth, filter);
|
||||
@@ -786,7 +786,7 @@ Value sendfrom(const Array& params, bool fHelp)
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
// Check funds
|
||||
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth);
|
||||
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, MINE_SPENDABLE);
|
||||
if (nAmount > nBalance)
|
||||
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
|
||||
|
||||
@@ -863,7 +863,7 @@ Value sendmany(const Array& params, bool fHelp)
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
// Check funds
|
||||
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth);
|
||||
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth, MINE_SPENDABLE);
|
||||
if (totalAmount > nBalance)
|
||||
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
|
||||
|
||||
@@ -1129,7 +1129,7 @@ static void MaybePushAddress(Object & entry, const CTxDestination &dest)
|
||||
entry.push_back(Pair("address", addr.ToString()));
|
||||
}
|
||||
|
||||
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret, const isminefilter& filter=MINE_SPENDABLE)
|
||||
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret, const isminefilter& filter)
|
||||
{
|
||||
int64_t nFee;
|
||||
string strSentAccount;
|
||||
@@ -1552,13 +1552,13 @@ Value gettransaction(const Array& params, bool fHelp)
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id");
|
||||
const CWalletTx& wtx = pwalletMain->mapWallet[hash];
|
||||
|
||||
int64_t nCredit = wtx.GetCredit();
|
||||
int64_t nDebit = wtx.GetDebit();
|
||||
int64_t nCredit = wtx.GetCredit(filter);
|
||||
int64_t nDebit = wtx.GetDebit(filter);
|
||||
int64_t nNet = nCredit - nDebit;
|
||||
int64_t nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);
|
||||
int64_t nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0);
|
||||
|
||||
entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
|
||||
if (wtx.IsFromMe())
|
||||
if (wtx.IsFromMe(filter))
|
||||
entry.push_back(Pair("fee", ValueFromAmount(nFee)));
|
||||
|
||||
WalletTxToJSON(wtx, entry);
|
||||
|
||||
Reference in New Issue
Block a user