Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2018 The Bitcoin developers | // Copyright (c) 2018 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_WALLET_WALLET_H | #ifndef BITCOIN_WALLET_WALLET_H | ||||
#define BITCOIN_WALLET_WALLET_H | #define BITCOIN_WALLET_WALLET_H | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <interfaces/chain.h> | |||||
#include <outputtype.h> | #include <outputtype.h> | ||||
#include <primitives/blockhash.h> | #include <primitives/blockhash.h> | ||||
#include <script/ismine.h> | #include <script/ismine.h> | ||||
#include <script/sign.h> | #include <script/sign.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
Show All 11 Lines | |||||
#include <map> | #include <map> | ||||
#include <memory> | #include <memory> | ||||
#include <set> | #include <set> | ||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <string> | #include <string> | ||||
#include <utility> | #include <utility> | ||||
#include <vector> | #include <vector> | ||||
namespace interfaces { | |||||
class Chain; | |||||
} // namespace interfaces | |||||
bool AddWallet(const std::shared_ptr<CWallet> &wallet); | bool AddWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool HasWallets(); | bool HasWallets(); | ||||
std::vector<std::shared_ptr<CWallet>> GetWallets(); | std::vector<std::shared_ptr<CWallet>> GetWallets(); | ||||
std::shared_ptr<CWallet> GetWallet(const std::string &name); | std::shared_ptr<CWallet> GetWallet(const std::string &name); | ||||
//! Default for -keypool | //! Default for -keypool | ||||
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000; | ||||
▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | public: | ||||
void SetMerkleBranch(const CBlockIndex *pIndex, int posInBlock); | void SetMerkleBranch(const CBlockIndex *pIndex, int posInBlock); | ||||
/** | /** | ||||
* Return depth of transaction in blockchain: | * Return depth of transaction in blockchain: | ||||
* <0 : conflicts with a transaction this deep in the blockchain | * <0 : conflicts with a transaction this deep in the blockchain | ||||
* 0 : in memory pool, waiting to be included in a block | * 0 : in memory pool, waiting to be included in a block | ||||
* >=1 : this many blocks deep in the main chain | * >=1 : this many blocks deep in the main chain | ||||
*/ | */ | ||||
int GetDepthInMainChain() const EXCLUSIVE_LOCKS_REQUIRED(cs_main); | int GetDepthInMainChain(interfaces::Chain::Lock &locked_chain) const; | ||||
bool IsInMainChain() const EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | bool IsInMainChain(interfaces::Chain::Lock &locked_chain) const { | ||||
return GetDepthInMainChain() > 0; | return GetDepthInMainChain(locked_chain) > 0; | ||||
} | } | ||||
/** | /** | ||||
* @return number of blocks to maturity for this transaction: | * @return number of blocks to maturity for this transaction: | ||||
* 0 : is not a coinbase transaction, or is a mature coinbase transaction | * 0 : is not a coinbase transaction, or is a mature coinbase transaction | ||||
* >0 : is a coinbase transaction which matures in this many blocks | * >0 : is a coinbase transaction which matures in this many blocks | ||||
*/ | */ | ||||
int GetBlocksToMaturity() const EXCLUSIVE_LOCKS_REQUIRED(cs_main); | int GetBlocksToMaturity(interfaces::Chain::Lock &locked_chain) const; | ||||
bool hashUnset() const { | bool hashUnset() const { | ||||
return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); | return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); | ||||
} | } | ||||
bool isAbandoned() const { return (hashBlock == ABANDON_HASH); } | bool isAbandoned() const { return (hashBlock == ABANDON_HASH); } | ||||
void setAbandoned() { hashBlock = ABANDON_HASH; } | void setAbandoned() { hashBlock = ABANDON_HASH; } | ||||
TxId GetId() const { return tx->GetId(); } | TxId GetId() const { return tx->GetId(); } | ||||
bool IsCoinBase() const { return tx->IsCoinBase(); } | bool IsCoinBase() const { return tx->IsCoinBase(); } | ||||
bool IsImmatureCoinBase() const EXCLUSIVE_LOCKS_REQUIRED(cs_main); | bool IsImmatureCoinBase(interfaces::Chain::Lock &locked_chain) const; | ||||
}; | }; | ||||
// Get the marginal bytes of spending the specified output | // Get the marginal bytes of spending the specified output | ||||
int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *pwallet, | int CalculateMaximumSignedInputSize(const CTxOut &txout, const CWallet *pwallet, | ||||
bool use_max_sig = false); | bool use_max_sig = false); | ||||
/** | /** | ||||
* A transaction with a bunch of additional info that only the owner cares | * A transaction with a bunch of additional info that only the owner cares | ||||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | public: | ||||
void BindWallet(CWallet *pwalletIn) { | void BindWallet(CWallet *pwalletIn) { | ||||
pwallet = pwalletIn; | pwallet = pwalletIn; | ||||
MarkDirty(); | MarkDirty(); | ||||
} | } | ||||
//! filter decides which addresses will count towards the debit | //! filter decides which addresses will count towards the debit | ||||
Amount GetDebit(const isminefilter &filter) const; | Amount GetDebit(const isminefilter &filter) const; | ||||
Amount GetCredit(const isminefilter &filter) const | Amount GetCredit(interfaces::Chain::Lock &locked_chain, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | const isminefilter &filter) const; | ||||
Amount GetImmatureCredit(bool fUseCache = true) const | Amount GetImmatureCredit(interfaces::Chain::Lock &locked_chain, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | bool fUseCache = true) const; | ||||
Amount | |||||
// TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct | // TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct | ||||
// annotation "EXCLUSIVE_LOCKS_REQUIRED(cs_main, pwallet->cs_wallet)". The | // annotation "EXCLUSIVE_LOCKS_REQUIRED(cs_main, pwallet->cs_wallet)". The | ||||
// annotation "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid | // annotation "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid | ||||
// having to resolve the issue of member access into incomplete type | // having to resolve the issue of member access into incomplete type | ||||
// CWallet. | // CWallet. | ||||
GetAvailableCredit(bool fUseCache = true, | Amount GetAvailableCredit(interfaces::Chain::Lock &locked_chain, | ||||
const isminefilter &filter = ISMINE_SPENDABLE) const | bool fUseCache = true, | ||||
NO_THREAD_SAFETY_ANALYSIS; | const isminefilter &filter = ISMINE_SPENDABLE) | ||||
Amount GetImmatureWatchOnlyCredit(const bool fUseCache = true) const | const NO_THREAD_SAFETY_ANALYSIS; | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | Amount GetImmatureWatchOnlyCredit(interfaces::Chain::Lock &locked_chain, | ||||
const bool fUseCache = true) const; | |||||
Amount GetChange() const; | Amount GetChange() const; | ||||
// Get the marginal bytes if spending the specified output from this | // Get the marginal bytes if spending the specified output from this | ||||
// transaction | // transaction | ||||
int GetSpendSize(unsigned int out, bool use_max_sig = false) const { | int GetSpendSize(unsigned int out, bool use_max_sig = false) const { | ||||
return CalculateMaximumSignedInputSize(tx->vout[out], pwallet, | return CalculateMaximumSignedInputSize(tx->vout[out], pwallet, | ||||
use_max_sig); | use_max_sig); | ||||
} | } | ||||
void GetAmounts(std::list<COutputEntry> &listReceived, | void GetAmounts(std::list<COutputEntry> &listReceived, | ||||
std::list<COutputEntry> &listSent, Amount &nFee, | std::list<COutputEntry> &listSent, Amount &nFee, | ||||
std::string &strSentAccount, | std::string &strSentAccount, | ||||
const isminefilter &filter) const; | const isminefilter &filter) const; | ||||
bool IsFromMe(const isminefilter &filter) const { | bool IsFromMe(const isminefilter &filter) const { | ||||
return GetDebit(filter) > Amount::zero(); | return GetDebit(filter) > Amount::zero(); | ||||
} | } | ||||
// True if only scriptSigs are different | // True if only scriptSigs are different | ||||
bool IsEquivalentTo(const CWalletTx &tx) const; | bool IsEquivalentTo(const CWalletTx &tx) const; | ||||
bool InMempool() const; | bool InMempool() const; | ||||
bool IsTrusted() const EXCLUSIVE_LOCKS_REQUIRED(cs_main); | bool IsTrusted(interfaces::Chain::Lock &locked_chain) const; | ||||
int64_t GetTxTime() const; | int64_t GetTxTime() const; | ||||
// RelayWalletTransaction may only be called if fBroadcastTransactions! | // RelayWalletTransaction may only be called if fBroadcastTransactions! | ||||
bool RelayWalletTransaction(CConnman *connman) | bool RelayWalletTransaction(interfaces::Chain::Lock &locked_chain, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | CConnman *connman); | ||||
/** | /** | ||||
* Pass this transaction to the mempool. Fails if absolute fee exceeds | * Pass this transaction to the mempool. Fails if absolute fee exceeds | ||||
* absurd fee. | * absurd fee. | ||||
*/ | */ | ||||
bool AcceptToMemoryPool(const Amount nAbsurdFee, CValidationState &state) | bool AcceptToMemoryPool(interfaces::Chain::Lock &locked_chain, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | const Amount nAbsurdFee, CValidationState &state); | ||||
// TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct | // TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct | ||||
// annotation "EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)". The annotation | // annotation "EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)". The annotation | ||||
// "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid having to | // "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid having to | ||||
// resolve the issue of member access into incomplete type CWallet. Note | // resolve the issue of member access into incomplete type CWallet. Note | ||||
// that we still have the runtime check "AssertLockHeld(pwallet->cs_wallet)" | // that we still have the runtime check "AssertLockHeld(pwallet->cs_wallet)" | ||||
// in place. | // in place. | ||||
std::set<TxId> GetConflicts() const NO_THREAD_SAFETY_ANALYSIS; | std::set<TxId> GetConflicts() const NO_THREAD_SAFETY_ANALYSIS; | ||||
▲ Show 20 Lines • Show All 402 Lines • ▼ Show 20 Lines | bool CanSupportFeature(enum WalletFeature wf) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { | ||||
AssertLockHeld(cs_wallet); | AssertLockHeld(cs_wallet); | ||||
return nWalletMaxVersion >= wf; | return nWalletMaxVersion >= wf; | ||||
} | } | ||||
/** | /** | ||||
* populate vCoins with vector of available COutputs. | * populate vCoins with vector of available COutputs. | ||||
*/ | */ | ||||
void AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe = true, | void AvailableCoins(interfaces::Chain::Lock &locked_chain, | ||||
std::vector<COutput> &vCoins, bool fOnlySafe = true, | |||||
const CCoinControl *coinControl = nullptr, | const CCoinControl *coinControl = nullptr, | ||||
const Amount nMinimumAmount = SATOSHI, | const Amount nMinimumAmount = SATOSHI, | ||||
const Amount nMaximumAmount = MAX_MONEY, | const Amount nMaximumAmount = MAX_MONEY, | ||||
const Amount nMinimumSumAmount = MAX_MONEY, | const Amount nMinimumSumAmount = MAX_MONEY, | ||||
const uint64_t nMaximumCount = 0, | const uint64_t nMaximumCount = 0, | ||||
const int nMinDepth = 0, | const int nMinDepth = 0, | ||||
const int nMaxDepth = 9999999) const | const int nMaxDepth = 9999999) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main, cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
/** | /** | ||||
* Return list of available coins and locked coins grouped by non-change | * Return list of available coins and locked coins grouped by non-change | ||||
* output address. | * output address. | ||||
*/ | */ | ||||
std::map<CTxDestination, std::vector<COutput>> ListCoins() const | std::map<CTxDestination, std::vector<COutput>> | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main, cs_wallet); | ListCoins(interfaces::Chain::Lock &locked_chain) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
/** | /** | ||||
* Find non-change parent output. | * Find non-change parent output. | ||||
*/ | */ | ||||
const CTxOut &FindNonChangeParentOutput(const CTransaction &tx, | const CTxOut &FindNonChangeParentOutput(const CTransaction &tx, | ||||
int output) const | int output) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
/** | /** | ||||
* Shuffle and select coins until nTargetValue is reached while avoiding | * Shuffle and select coins until nTargetValue is reached while avoiding | ||||
* small change; This method is stochastic for some inputs and upon | * small change; This method is stochastic for some inputs and upon | ||||
* completion the coin set and corresponding actual target value is | * completion the coin set and corresponding actual target value is | ||||
* assembled. | * assembled. | ||||
*/ | */ | ||||
bool SelectCoinsMinConf(const Amount nTargetValue, | bool SelectCoinsMinConf(const Amount nTargetValue, | ||||
const CoinEligibilityFilter &eligibility_filter, | const CoinEligibilityFilter &eligibility_filter, | ||||
std::vector<OutputGroup> groups, | std::vector<OutputGroup> groups, | ||||
std::set<CInputCoin> &setCoinsRet, | std::set<CInputCoin> &setCoinsRet, | ||||
Amount &nValueRet, | Amount &nValueRet, | ||||
const CoinSelectionParams &coin_selection_params, | const CoinSelectionParams &coin_selection_params, | ||||
bool &bnb_used) const; | bool &bnb_used) const; | ||||
bool IsSpent(const COutPoint &outpoint) const | bool IsSpent(interfaces::Chain::Lock &locked_chain, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main, cs_wallet); | const COutPoint &outpoint) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | |||||
std::vector<OutputGroup> GroupOutputs(const std::vector<COutput> &outputs, | std::vector<OutputGroup> GroupOutputs(const std::vector<COutput> &outputs, | ||||
bool single_coin) const; | bool single_coin) const; | ||||
bool IsLockedCoin(const COutPoint &outpoint) const | bool IsLockedCoin(const COutPoint &outpoint) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
void LockCoin(const COutPoint &output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | void LockCoin(const COutPoint &output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
void UnlockCoin(const COutPoint &output) | void UnlockCoin(const COutPoint &output) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | public: | ||||
//! Lock(). | //! Lock(). | ||||
int64_t nRelockTime = 0; | int64_t nRelockTime = 0; | ||||
bool Unlock(const SecureString &strWalletPassphrase); | bool Unlock(const SecureString &strWalletPassphrase); | ||||
bool ChangeWalletPassphrase(const SecureString &strOldWalletPassphrase, | bool ChangeWalletPassphrase(const SecureString &strOldWalletPassphrase, | ||||
const SecureString &strNewWalletPassphrase); | const SecureString &strNewWalletPassphrase); | ||||
bool EncryptWallet(const SecureString &strWalletPassphrase); | bool EncryptWallet(const SecureString &strWalletPassphrase); | ||||
void GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth) const | void GetKeyBirthTimes(interfaces::Chain::Lock &locked_chain, | ||||
std::map<CTxDestination, int64_t> &mapKeyBirth) const | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
unsigned int ComputeTimeSmart(const CWalletTx &wtx) const; | unsigned int ComputeTimeSmart(const CWalletTx &wtx) const; | ||||
/** | /** | ||||
* Increment the next transaction order id | * Increment the next transaction order id | ||||
* @return next transaction order id | * @return next transaction order id | ||||
*/ | */ | ||||
int64_t IncOrderPosNext(WalletBatch *batch = nullptr) | int64_t IncOrderPosNext(WalletBatch *batch = nullptr) | ||||
Show All 25 Lines | CBlockIndex *ScanForWalletTransactions(CBlockIndex *pindexStart, | ||||
bool fUpdate = false); | bool fUpdate = false); | ||||
void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; | void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; | ||||
void ReacceptWalletTransactions(); | void ReacceptWalletTransactions(); | ||||
void ResendWalletTransactions(int64_t nBestBlockTime, | void ResendWalletTransactions(int64_t nBestBlockTime, | ||||
CConnman *connman) override | CConnman *connman) override | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
// ResendWalletTransactionsBefore may only be called if | // ResendWalletTransactionsBefore may only be called if | ||||
// fBroadcastTransactions! | // fBroadcastTransactions! | ||||
std::vector<uint256> ResendWalletTransactionsBefore(int64_t nTime, | std::vector<uint256> | ||||
CConnman *connman) | ResendWalletTransactionsBefore(interfaces::Chain::Lock &locked_chain, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | int64_t nTime, CConnman *connman); | ||||
Amount GetBalance(const isminefilter &filter = ISMINE_SPENDABLE, | Amount GetBalance(const isminefilter &filter = ISMINE_SPENDABLE, | ||||
const int min_depth = 0) const; | const int min_depth = 0) const; | ||||
Amount GetUnconfirmedBalance() const; | Amount GetUnconfirmedBalance() const; | ||||
Amount GetImmatureBalance() const; | Amount GetImmatureBalance() const; | ||||
Amount GetUnconfirmedWatchOnlyBalance() const; | Amount GetUnconfirmedWatchOnlyBalance() const; | ||||
Amount GetImmatureWatchOnlyBalance() const; | Amount GetImmatureWatchOnlyBalance() const; | ||||
Amount GetLegacyBalance(const isminefilter &filter, int minDepth, | Amount GetLegacyBalance(const isminefilter &filter, int minDepth, | ||||
const std::string *account) const; | const std::string *account) const; | ||||
Show All 15 Lines | bool SignTransaction(CMutableTransaction &tx) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
/** | /** | ||||
* Create a new transaction paying the recipients with a set of coins | * Create a new transaction paying the recipients with a set of coins | ||||
* selected by SelectCoins(); Also create the change output, when needed | * selected by SelectCoins(); Also create the change output, when needed | ||||
* @note passing nChangePosInOut as -1 will result in setting a random | * @note passing nChangePosInOut as -1 will result in setting a random | ||||
* position | * position | ||||
*/ | */ | ||||
bool CreateTransaction(const std::vector<CRecipient> &vecSend, | bool CreateTransaction(interfaces::Chain::Lock &locked_chain, | ||||
const std::vector<CRecipient> &vecSend, | |||||
CTransactionRef &tx, CReserveKey &reservekey, | CTransactionRef &tx, CReserveKey &reservekey, | ||||
Amount &nFeeRet, int &nChangePosInOut, | Amount &nFeeRet, int &nChangePosInOut, | ||||
std::string &strFailReason, | std::string &strFailReason, | ||||
const CCoinControl &coin_control, bool sign = true); | const CCoinControl &coin_control, bool sign = true); | ||||
bool CommitTransaction( | bool CommitTransaction( | ||||
CTransactionRef tx, mapValue_t mapValue, | CTransactionRef tx, mapValue_t mapValue, | ||||
std::vector<std::pair<std::string, std::string>> orderForm, | std::vector<std::pair<std::string, std::string>> orderForm, | ||||
std::string fromAccount, CReserveKey &reservekey, CConnman *connman, | std::string fromAccount, CReserveKey &reservekey, CConnman *connman, | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | public: | ||||
void MarkReserveKeysAsUsed(int64_t keypool_id) | void MarkReserveKeysAsUsed(int64_t keypool_id) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
const std::map<CKeyID, int64_t> &GetAllReserveKeys() const { | const std::map<CKeyID, int64_t> &GetAllReserveKeys() const { | ||||
return m_pool_key_to_index; | return m_pool_key_to_index; | ||||
} | } | ||||
std::set<std::set<CTxDestination>> GetAddressGroupings() | std::set<std::set<CTxDestination>> GetAddressGroupings() | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); | ||||
std::map<CTxDestination, Amount> GetAddressBalances() | std::map<CTxDestination, Amount> | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | GetAddressBalances(interfaces::Chain::Lock &locked_chain); | ||||
std::set<CTxDestination> GetLabelAddresses(const std::string &label) const; | std::set<CTxDestination> GetLabelAddresses(const std::string &label) const; | ||||
void DeleteLabel(const std::string &label); | void DeleteLabel(const std::string &label); | ||||
isminetype IsMine(const CTxIn &txin) const; | isminetype IsMine(const CTxIn &txin) const; | ||||
/** | /** | ||||
* Returns amount of debit if the input matches the filter, otherwise | * Returns amount of debit if the input matches the filter, otherwise | ||||
* returns 0 | * returns 0 | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | public: | ||||
/** Return whether transaction can be abandoned */ | /** Return whether transaction can be abandoned */ | ||||
bool TransactionCanBeAbandoned(const TxId &txid) const; | bool TransactionCanBeAbandoned(const TxId &txid) const; | ||||
/** | /** | ||||
* Mark a transaction (and it in-wallet descendants) as abandoned so its | * Mark a transaction (and it in-wallet descendants) as abandoned so its | ||||
* inputs may be respent. | * inputs may be respent. | ||||
*/ | */ | ||||
bool AbandonTransaction(const TxId &txid); | bool AbandonTransaction(interfaces::Chain::Lock &locked_chain, | ||||
const TxId &txid); | |||||
//! Verify wallet naming and perform salvage on the wallet if required | //! Verify wallet naming and perform salvage on the wallet if required | ||||
static bool Verify(const CChainParams &chainParams, | static bool Verify(const CChainParams &chainParams, | ||||
interfaces::Chain &chain, const WalletLocation &location, | interfaces::Chain &chain, const WalletLocation &location, | ||||
bool salvage_wallet, std::string &error_string, | bool salvage_wallet, std::string &error_string, | ||||
std::string &warning_string); | std::string &warning_string); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |