Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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 <logging.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/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

Enumerations

enum class  PSBTError

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.
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.
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 ...
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< CWalletwallet::GetDefaultWallet (WalletContext &context, size_t &count)
std::shared_ptr< CWalletwallet::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)
std::shared_ptr< CWalletwallet::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< CWalletwallet::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< CWalletwallet::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.
static util::Result< fs::pathwallet::GetWalletPath (const std::string &name)
std::unique_ptr< WalletDatabasewallet::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) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
util::Result< MigrationResultwallet::MigrateLegacyToDescriptor (const std::string &wallet_name, const SecureString &passphrase, WalletContext &context)
 Do all steps to migrate a legacy wallet to a descriptor wallet.
util::Result< MigrationResultwallet::MigrateLegacyToDescriptor (std::shared_ptr< CWallet > local_wallet, const SecureString &passphrase, WalletContext &context)
 Requirement: The wallet provided to this function must be isolated, with no attachment to the node's context.
bilingual_str AmountErrMsg (const std::string &optname, const std::string &strValue)
bilingual_str AmountHighWarn (const std::string &optname)
void ReplaceAll (std::string &in_out, const std::string &search, const std::string &substitute)
template<typename T>
std::string ToString (const T &t)
 Locale-independent version of std::to_string.

Variables

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

Enumeration Type Documentation

◆ PSBTError

enum class common::PSBTError
strong

Definition at line 17 of file types.h.

Function Documentation

◆ AmountErrMsg()

bilingual_str common::AmountErrMsg ( const std::string & optname,
const std::string & strValue )

Definition at line 166 of file messages.cpp.

◆ AmountHighWarn()

bilingual_str common::AmountHighWarn ( const std::string & optname)

Definition at line 161 of file messages.cpp.

◆ ReplaceAll()

void util::ReplaceAll ( std::string & in_out,
const std::string & search,
const std::string & substitute )

Definition at line 11 of file string.cpp.

◆ ToString()

template<typename T>
std::string util::ToString ( const T & t)

Locale-independent version of std::to_string.

Definition at line 246 of file string.h.