aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-03-11 16:12:58 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-04-04 13:22:08 -0400
commitfa57411fcba00556ba25d45bca53cc04623da051 (patch)
tree4c5d2cc2163356008e9ad6802b8544526216e805 /src/wallet/wallet.h
parentdaef20fb50c00240ea4a5d653f3a47ee604d25c1 (diff)
wallet: Get all balances in one call
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 3aeeaafd1f..fd274fa375 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -947,11 +947,15 @@ public:
void TransactionRemovedFromMempool(const CTransactionRef &ptx) override;
void ReacceptWalletTransactions(interfaces::Chain::Lock& locked_chain) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
void ResendWalletTransactions(interfaces::Chain::Lock& locked_chain, int64_t nBestBlockTime) override;
- CAmount GetBalance(const isminefilter& filter=ISMINE_SPENDABLE, const int min_depth=0) const;
- CAmount GetUnconfirmedBalance() const;
- CAmount GetImmatureBalance() const;
- CAmount GetUnconfirmedWatchOnlyBalance() const;
- CAmount GetImmatureWatchOnlyBalance() const;
+ struct Balance {
+ CAmount m_mine_trusted{0}; //!< Trusted, at depth=GetBalance.min_depth or more
+ CAmount m_mine_untrusted_pending{0}; //!< Untrusted, but in mempool (pending)
+ CAmount m_mine_immature{0}; //!< Immature coinbases in the main chain
+ CAmount m_watchonly_trusted{0};
+ CAmount m_watchonly_untrusted_pending{0};
+ CAmount m_watchonly_immature{0};
+ };
+ Balance GetBalance(int min_depth = 0) const;
CAmount GetAvailableBalance(const CCoinControl* coinControl = nullptr) const;
OutputType TransactionChangeType(OutputType change_type, const std::vector<CRecipient>& vecSend);