mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge c5fa7ed409 into merged_master (Bitcoin PR bitcoin/bitcoin#25544)
This commit is contained in:
commit
dfa9412306
1 changed files with 6 additions and 10 deletions
|
|
@ -160,12 +160,10 @@ CAmountMap CachedTxGetCredit(const CWallet& wallet, const CWalletTx& wtx, const
|
|||
return CAmountMap();
|
||||
|
||||
CAmountMap credit;
|
||||
if (filter & ISMINE_SPENDABLE) {
|
||||
const isminefilter get_amount_filter{filter & ISMINE_ALL};
|
||||
if (get_amount_filter) {
|
||||
// GetBalance can assume transactions in mapWallet won't change
|
||||
credit += GetCachableAmount(wallet, wtx, CWalletTx::CREDIT, ISMINE_SPENDABLE);
|
||||
}
|
||||
if (filter & ISMINE_WATCH_ONLY) {
|
||||
credit += GetCachableAmount(wallet, wtx, CWalletTx::CREDIT, ISMINE_WATCH_ONLY);
|
||||
credit += GetCachableAmount(wallet, wtx, CWalletTx::CREDIT, get_amount_filter);
|
||||
}
|
||||
return credit;
|
||||
}
|
||||
|
|
@ -176,11 +174,9 @@ CAmountMap CachedTxGetDebit(const CWallet& wallet, const CWalletTx& wtx, const i
|
|||
return CAmountMap();
|
||||
|
||||
CAmountMap debit;
|
||||
if (filter & ISMINE_SPENDABLE) {
|
||||
debit += GetCachableAmount(wallet, wtx, CWalletTx::DEBIT, ISMINE_SPENDABLE);
|
||||
}
|
||||
if (filter & ISMINE_WATCH_ONLY) {
|
||||
debit += GetCachableAmount(wallet, wtx, CWalletTx::DEBIT, ISMINE_WATCH_ONLY);
|
||||
const isminefilter get_amount_filter{filter & ISMINE_ALL};
|
||||
if (get_amount_filter) {
|
||||
debit += GetCachableAmount(wallet, wtx, CWalletTx::DEBIT, get_amount_filter);
|
||||
}
|
||||
return debit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue