Bitcoin Core 28.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/chain.h>
#include <kernel/mempool_removal_reason.h>
#include <key.h>
#include <key_io.h>
#include <logging.h>
#include <node/types.h>
#include <outputtype.h>
#include <policy/feerate.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/fs.h>
#include <util/fs_helpers.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/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 <optional>
#include <stdexcept>
#include <thread>
#include <tuple>
#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)
 
void wallet::MaybeResendWalletTxs (WalletContext &context)
 Called periodically by the schedule thread. More...
 
static util::Result< fs::pathwallet::GetWalletPath (const std::string &name)
 
std::unique_ptr< WalletDatabase > wallet::MakeWalletDatabase (const std::string &name, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error_string)
 
bool wallet::DoMigration (CWallet &wallet, WalletContext &context, bilingual_str &error, MigrationResult &res) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
 
util::Result< MigrationResult > wallet::MigrateLegacyToDescriptor (const std::string &wallet_name, const SecureString &passphrase, WalletContext &context)
 Do all steps to migrate a legacy wallet to a descriptor wallet. 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
 

Variable Documentation

◆ m_filter_set

GCSFilter::ElementSet m_filter_set
private

Definition at line 359 of file wallet.cpp.

◆ m_last_range_ends

std::map<uint256, int32_t> m_last_range_ends
private

Map for keeping track of each range descriptor's last seen end range.

This information is used to detect whether new addresses were derived (that is, if the current end range is larger than the saved end range) after processing a block and hence a filter set update is needed to take possible keypool top-ups into account.

Definition at line 358 of file wallet.cpp.

◆ m_wallet

const CWallet& m_wallet
private

Definition at line 351 of file wallet.cpp.