![]() |
Bitcoin Core
0.21.1
P2P Digital Currency
|
#include <wallet/wallet.h>#include <chain.h>#include <consensus/consensus.h>#include <consensus/validation.h>#include <fs.h>#include <interfaces/chain.h>#include <interfaces/wallet.h>#include <key.h>#include <key_io.h>#include <optional.h>#include <policy/fees.h>#include <policy/policy.h>#include <primitives/block.h>#include <primitives/transaction.h>#include <script/descriptor.h>#include <script/script.h>#include <script/signingprovider.h>#include <txmempool.h>#include <util/bip32.h>#include <util/check.h>#include <util/error.h>#include <util/fees.h>#include <util/moneystr.h>#include <util/rbf.h>#include <util/string.h>#include <util/translation.h>#include <wallet/coincontrol.h>#include <wallet/fees.h>#include <univalue.h>#include <algorithm>#include <assert.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 | AddWalletSetting (interfaces::Chain &chain, const std::string &wallet_name) |
| Add wallet name to persistent configuration so it will be loaded on startup. More... | |
| bool | RemoveWalletSetting (interfaces::Chain &chain, const std::string &wallet_name) |
| Remove wallet name from persistent configuration so it will not be loaded on startup. More... | |
| static void | UpdateWalletSetting (interfaces::Chain &chain, const std::string &wallet_name, Optional< bool > load_on_startup, std::vector< bilingual_str > &warnings) |
| bool | AddWallet (const std::shared_ptr< CWallet > &wallet) |
| bool | RemoveWallet (const std::shared_ptr< CWallet > &wallet, Optional< bool > load_on_start, std::vector< bilingual_str > &warnings) |
| bool | RemoveWallet (const std::shared_ptr< CWallet > &wallet, Optional< bool > load_on_start) |
| 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 std::set< std::string > g_loading_wallet_set | GUARDED_BY (g_loading_wallet_mutex) |
| static std::set< std::string > g_unloading_wallet_set | GUARDED_BY (g_wallet_release_mutex) |
| static void | ReleaseWallet (CWallet *wallet) |
| void | UnloadWallet (std::shared_ptr< CWallet > &&wallet) |
| Explicitly unload and delete the wallet. More... | |
| std::shared_ptr< CWallet > | LoadWallet (interfaces::Chain &chain, const std::string &name, Optional< bool > load_on_start, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings) |
| std::shared_ptr< CWallet > | CreateWallet (interfaces::Chain &chain, const std::string &name, Optional< bool > load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings) |
| 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 uint256 &block_hash) |
| static uint32_t | GetLocktimeForNewTransaction (interfaces::Chain &chain, const uint256 &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... | |
| std::unique_ptr< WalletDatabase > | MakeWalletDatabase (const std::string &name, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error_string) |
Variables | |
| const std::map< uint64_t, std::string > | WALLET_FLAG_CAVEATS |
| static const size_t | OUTPUT_GROUP_MAX_ENTRIES = 10 |
| static RecursiveMutex | cs_wallets |
| static Mutex | g_loading_wallet_mutex |
| static Mutex | g_wallet_release_mutex |
| static std::condition_variable | g_wallet_release_cv |
| bool AddWallet | ( | const std::shared_ptr< CWallet > & | wallet | ) |
| bool AddWalletSetting | ( | interfaces::Chain & | chain, |
| const std::string & | wallet_name | ||
| ) |
Add wallet name to persistent configuration so it will be loaded on startup.
Definition at line 59 of file wallet.cpp.
| std::shared_ptr<CWallet> CreateWallet | ( | interfaces::Chain & | chain, |
| const std::string & | name, | ||
| Optional< bool > | load_on_start, | ||
| DatabaseOptions & | options, | ||
| DatabaseStatus & | status, | ||
| bilingual_str & | error, | ||
| std::vector< bilingual_str > & | warnings | ||
| ) |
Definition at line 247 of file wallet.cpp.
| std::shared_ptr<CWallet> GetWallet | ( | const std::string & | name | ) |
| std::vector<std::shared_ptr<CWallet> > GetWallets | ( | ) |
|
static |
|
static |
|
static |
| std::unique_ptr<interfaces::Handler> HandleLoadWallet | ( | LoadWalletFn | load_wallet | ) |
| std::shared_ptr<CWallet> LoadWallet | ( | interfaces::Chain & | chain, |
| const std::string & | name, | ||
| Optional< bool > | load_on_start, | ||
| const DatabaseOptions & | options, | ||
| DatabaseStatus & | status, | ||
| bilingual_str & | error, | ||
| std::vector< bilingual_str > & | warnings | ||
| ) |
Definition at line 234 of file wallet.cpp.
| std::unique_ptr<WalletDatabase> MakeWalletDatabase | ( | const std::string & | name, |
| const DatabaseOptions & | options, | ||
| DatabaseStatus & | status, | ||
| bilingual_str & | error_string | ||
| ) |
Definition at line 3769 of file wallet.cpp.
| 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 2113 of file wallet.cpp.
|
static |
Definition at line 162 of file wallet.cpp.
| bool RemoveWallet | ( | const std::shared_ptr< CWallet > & | wallet, |
| Optional< bool > | load_on_start, | ||
| std::vector< bilingual_str > & | warnings | ||
| ) |
Definition at line 107 of file wallet.cpp.
| bool RemoveWalletSetting | ( | interfaces::Chain & | chain, |
| const std::string & | wallet_name | ||
| ) |
Remove wallet name from persistent configuration so it will not be loaded on startup.
Definition at line 70 of file wallet.cpp.
| 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 179 of file wallet.cpp.
|
static |
Definition at line 82 of file wallet.cpp.
|
static |
Definition at line 55 of file wallet.cpp.
|
static |
Definition at line 155 of file wallet.cpp.
|
static |
Definition at line 157 of file wallet.cpp.
|
static |
Definition at line 156 of file wallet.cpp.
|
static |
Definition at line 53 of file wallet.cpp.
| const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS |
Definition at line 45 of file wallet.cpp.
1.8.8