![]() |
Bitcoin ABC
0.22.13
P2P Digital Currency
|
#include <wallet/wallet.h>
#include <chain.h>
#include <chainparams.h>
#include <config.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <fs.h>
#include <interfaces/wallet.h>
#include <key.h>
#include <key_io.h>
#include <policy/mempool.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <random.h>
#include <script/descriptor.h>
#include <script/script.h>
#include <script/sighashtype.h>
#include <script/sign.h>
#include <script/signingprovider.h>
#include <util/bip32.h>
#include <util/check.h>
#include <util/error.h>
#include <util/moneystr.h>
#include <util/string.h>
#include <util/translation.h>
#include <wallet/coincontrol.h>
#include <wallet/fees.h>
#include <boost/algorithm/string/replace.hpp>
Go to the source code of this file.
Functions | |
static std::vector< std::shared_ptr< CWallet > > vpwallets | GUARDED_BY (cs_wallets) |
bool | AddWallet (const std::shared_ptr< CWallet > &wallet) |
bool | RemoveWallet (const std::shared_ptr< CWallet > &wallet) |
bool | HasWallets () |
std::vector< std::shared_ptr< CWallet > > | GetWallets () |
std::shared_ptr< CWallet > | GetWallet (const std::string &name) |
std::unique_ptr< interfaces::Handler > | HandleLoadWallet (LoadWalletFn load_wallet) |
static void | ReleaseWallet (CWallet *wallet) |
void | UnloadWallet (std::shared_ptr< CWallet > &&wallet) |
Explicitly unload and delete the wallet. More... | |
std::shared_ptr< CWallet > | LoadWallet (const CChainParams &chainParams, interfaces::Chain &chain, const WalletLocation &location, bilingual_str &error, std::vector< bilingual_str > &warnings) |
std::shared_ptr< CWallet > | LoadWallet (const CChainParams &chainParams, interfaces::Chain &chain, const std::string &name, bilingual_str &error, std::vector< bilingual_str > &warnings) |
WalletCreationStatus | CreateWallet (const CChainParams ¶ms, interfaces::Chain &chain, const SecureString &passphrase, uint64_t wallet_creation_flags, const std::string &name, bilingual_str &error, std::vector< bilingual_str > &warnings, std::shared_ptr< CWallet > &result) |
int64_t | CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, bool use_max_sig) |
int64_t | CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, const std::vector< CTxOut > &txouts, bool use_max_sig) |
int | CalculateMaximumSignedInputSize (const CTxOut &txout, const CWallet *wallet, bool use_max_sig) |
void | MaybeResendWalletTxs () |
Called periodically by the schedule thread. More... | |
static bool | IsCurrentForAntiFeeSniping (interfaces::Chain &chain, const BlockHash &block_hash) |
static uint32_t | GetLocktimeForNewTransaction (interfaces::Chain &chain, const BlockHash &block_hash, int block_height) |
Return a height-based locktime for new transactions (uses the height of the current chain tip unless we are not synced with the current chain. More... | |
Variables | |
const std::map< uint64_t, std::string > | WALLET_FLAG_CAVEATS |
static RecursiveMutex | cs_wallets |
static Mutex | g_wallet_release_mutex |
static std::condition_variable | g_wallet_release_cv |
static std::set< std::string > | g_unloading_wallet_set |
static const size_t | OUTPUT_GROUP_MAX_ENTRIES = 10 |
bool AddWallet | ( | const std::shared_ptr< CWallet > & | wallet | ) |
WalletCreationStatus CreateWallet | ( | const CChainParams & | params, |
interfaces::Chain & | chain, | ||
const SecureString & | passphrase, | ||
uint64_t | wallet_creation_flags, | ||
const std::string & | name, | ||
bilingual_str & | error, | ||
std::vector< bilingual_str > & | warnings, | ||
std::shared_ptr< CWallet > & | result | ||
) |
std::shared_ptr<CWallet> GetWallet | ( | const std::string & | name | ) |
std::vector<std::shared_ptr<CWallet> > GetWallets | ( | ) |
|
static |
std::unique_ptr<interfaces::Handler> HandleLoadWallet | ( | LoadWalletFn | load_wallet | ) |
bool HasWallets | ( | ) |
std::shared_ptr<CWallet> LoadWallet | ( | const CChainParams & | chainParams, |
interfaces::Chain & | chain, | ||
const WalletLocation & | location, | ||
bilingual_str & | error, | ||
std::vector< bilingual_str > & | warnings | ||
) |
Definition at line 154 of file wallet.cpp.
std::shared_ptr<CWallet> LoadWallet | ( | const CChainParams & | chainParams, |
interfaces::Chain & | chain, | ||
const std::string & | name, | ||
bilingual_str & | error, | ||
std::vector< bilingual_str > & | warnings | ||
) |
void MaybeResendWalletTxs | ( | ) |
Called periodically by the schedule thread.
Prompts individual wallets to resend their transactions. Actual rebroadcast schedule is managed by the wallets themselves.
Definition at line 2241 of file wallet.cpp.
|
static |
Definition at line 113 of file wallet.cpp.
bool RemoveWallet | ( | const std::shared_ptr< CWallet > & | wallet | ) |
void UnloadWallet | ( | std::shared_ptr< CWallet > && | wallet | ) |
Explicitly unload and delete the wallet.
Blocks the current thread after signaling the unload intent so that all wallet clients release the wallet. Note that, when blocking is not required, the wallet is implicitly unloaded by the shared pointer deleter.
Definition at line 129 of file wallet.cpp.
|
static |
Definition at line 46 of file wallet.cpp.
|
static |
Definition at line 110 of file wallet.cpp.
|
static |
Definition at line 109 of file wallet.cpp.
|
static |
Definition at line 108 of file wallet.cpp.
|
static |
Definition at line 152 of file wallet.cpp.
const std::map<uint64_t, std::string> WALLET_FLAG_CAVEATS |
Definition at line 39 of file wallet.cpp.