mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
removed default argument values for ismine filter
This commit is contained in:
parent
d5087d1ba0
commit
80dda36a07
5 changed files with 32 additions and 31 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue