diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-03-11 16:12:58 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-04-04 13:22:08 -0400 |
commit | fa57411fcba00556ba25d45bca53cc04623da051 (patch) | |
tree | 4c5d2cc2163356008e9ad6802b8544526216e805 /src/wallet/wallet.h | |
parent | daef20fb50c00240ea4a5d653f3a47ee604d25c1 (diff) |
wallet: Get all balances in one call
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 14 |
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); |