Bitcoin Core 32.99.0
P2P Digital Currency
Namespaces | Functions | Variables
wallet.cpp File Reference
#include <wallet/wallet.h>
#include <bitcoin-build-config.h>
#include <addresstype.h>
#include <blockfilter.h>
#include <chain.h>
#include <coins.h>
#include <common/args.h>
#include <common/messages.h>
#include <common/settings.h>
#include <common/signmessage.h>
#include <common/system.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <external_signer.h>
#include <interfaces/chain.h>
#include <interfaces/handler.h>
#include <interfaces/wallet.h>
#include <kernel/mempool_removal_reason.h>
#include <kernel/types.h>
#include <key.h>
#include <key_io.h>
#include <node/types.h>
#include <outputtype.h>
#include <policy/feerate.h>
#include <policy/truc_policy.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <psbt.h>
#include <pubkey.h>
#include <random.h>
#include <script/descriptor.h>
#include <script/interpreter.h>
#include <script/script.h>
#include <script/sign.h>
#include <script/signingprovider.h>
#include <script/solver.h>
#include <serialize.h>
#include <span.h>
#include <streams.h>
#include <support/allocators/secure.h>
#include <support/allocators/zeroafterfree.h>
#include <support/cleanse.h>
#include <sync.h>
#include <tinyformat.h>
#include <uint256.h>
#include <univalue.h>
#include <util/check.h>
#include <util/expected.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/log.h>
#include <util/moneystr.h>
#include <util/result.h>
#include <util/string.h>
#include <util/time.h>
#include <util/translation.h>
#include <wallet/coincontrol.h>
#include <wallet/context.h>
#include <wallet/crypter.h>
#include <wallet/db.h>
#include <wallet/external_signer_scriptpubkeyman.h>
#include <wallet/scan.h>
#include <wallet/scriptpubkeyman.h>
#include <wallet/transaction.h>
#include <wallet/types.h>
#include <wallet/walletdb.h>
#include <wallet/walletutil.h>
#include <algorithm>
#include <cassert>
#include <condition_variable>
#include <exception>
#include <limits>
#include <optional>
#include <stdexcept>
#include <thread>
#include <tuple>
#include <utility>
#include <variant>

Go to the source code of this file.

Namespaces

namespace  wallet
 

Functions

bool wallet::AddWalletSetting (interfaces::Chain &chain, const std::string &wallet_name)
 Add wallet name to persistent configuration so it will be loaded on startup. More...
 
bool wallet::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 wallet::UpdateWalletSetting (interfaces::Chain &chain, const std::string &wallet_name, std::optional< bool > load_on_startup, std::vector< bilingual_str > &warnings)
 
static void wallet::RefreshMempoolStatus (CWalletTx &tx, interfaces::Chain &chain)
 Refresh mempool status so the wallet is in an internally consistent state and immediately knows the transaction's status: Whether it can be considered trusted and is eligible to be abandoned ... More...
 
bool wallet::AddWallet (WalletContext &context, const std::shared_ptr< CWallet > &wallet)
 
bool wallet::RemoveWallet (WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start, std::vector< bilingual_str > &warnings)
 
bool wallet::RemoveWallet (WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start)
 
std::vector< std::shared_ptr< CWallet > > wallet::GetWallets (WalletContext &context)
 
std::shared_ptr< CWallet > wallet::GetDefaultWallet (WalletContext &context, size_t &count)
 
std::shared_ptr< CWallet > wallet::GetWallet (WalletContext &context, const std::string &name)
 
std::unique_ptr< interfaces::Handlerwallet::HandleLoadWallet (WalletContext &context, LoadWalletFn load_wallet)
 
void wallet::NotifyWalletLoaded (WalletContext &context, const std::shared_ptr< CWallet > &wallet)
 
static std::set< std::string > g_loading_wallet_set wallet::GUARDED_BY (g_loading_wallet_mutex)
 
static std::set< std::string > g_unloading_wallet_set wallet::GUARDED_BY (g_wallet_release_mutex)
 
static void wallet::FlushAndDeleteWallet (CWallet *wallet)
 
void wallet::WaitForDeleteWallet (std::shared_ptr< CWallet > &&wallet)
 Explicitly delete the wallet. More...
 
std::shared_ptr< CWallet > wallet::LoadWallet (WalletContext &context, const std::string &name, std::optional< bool > load_on_start, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
 
std::shared_ptr< CWallet > wallet::CreateWallet (WalletContext &context, const std::string &name, std::optional< bool > load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
 
std::shared_ptr< CWallet > wallet::RestoreWallet (WalletContext &context, const fs::path &backup_file, const std::string &wallet_name, std::optional< bool > load_on_start, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings, bool load_after_restore, bool allow_unnamed)
 
static bool wallet::EncryptMasterKey (const SecureString &wallet_passphrase, const CKeyingMaterial &plain_master_key, CMasterKey &master_key)
 
static bool wallet::DecryptMasterKey (const SecureString &wallet_passphrase, const CMasterKey &master_key, CKeyingMaterial &plain_master_key)
 
void wallet::MaybeResendWalletTxs (WalletContext &context)
 Called periodically by the schedule thread. More...
 
util::Result< fs::pathwallet::GetWalletPath (const std::string &name)
 Determine the path that the wallet is stored in. More...
 
std::unique_ptr< WalletDatabase > wallet::MakeWalletDatabase (const std::string &name, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error_string)
 
static std::string wallet::MigrationPrefixName (CWallet &wallet)
 
bool wallet::DoMigration (CWallet &wallet, WalletContext &context, bilingual_str &error, MigrationResult &res, const bool load_on_startup=true) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 
util::Result< MigrationResult > wallet::MigrateLegacyToDescriptor (const std::string &wallet_name, const SecureString &passphrase, WalletContext &context, bool load_wallet=true)
 Do all steps to migrate a legacy wallet to a descriptor wallet. More...
 
util::Result< MigrationResult > wallet::MigrateLegacyToDescriptor (std::shared_ptr< CWallet > local_wallet, const SecureString &passphrase, WalletContext &context, bool load_wallet=true)
 Requirement: The wallet provided to this function must be isolated, with no attachment to the node's context. More...
 

Variables

static GlobalMutex wallet::g_loading_wallet_mutex
 
static GlobalMutex wallet::g_wallet_release_mutex
 
static std::condition_variable wallet::g_wallet_release_cv