Bitcoin
|
#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 <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 <util/bip32.h>
#include <util/error.h>
#include <util/fees.h>
#include <util/moneystr.h>
#include <util/rbf.h>
#include <util/validation.h>
#include <validation.h>
#include <wallet/coincontrol.h>
#include <wallet/fees.h>
#include <algorithm>
#include <assert.h>
#include <future>
#include <boost/algorithm/string/replace.hpp>
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) |
static void | ReleaseWallet (CWallet *wallet) |
void | UnloadWallet (std::shared_ptr< CWallet > &&wallet) |
std::shared_ptr< CWallet > | LoadWallet (interfaces::Chain &chain, const WalletLocation &location, std::string &error, std::string &warning) |
std::shared_ptr< CWallet > | LoadWallet (interfaces::Chain &chain, const std::string &name, std::string &error, std::string &warning) |
std::shared_ptr< CWallet > | CreateWallet (interfaces::Chain &chain, const std::string &name, std::string &error, std::string &warning, WalletCreationStatus &status, const SecureString &passphrase, uint64_t wallet_creation_flags) |
std::vector< CKeyID > | GetAffectedKeys (const CScript &spk, const SigningProvider &provider) |
static bool | ExtractPubKey (const CScript &dest, CPubKey &pubKeyOut) |
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 () |
static bool | IsCurrentForAntiFeeSniping (interfaces::Chain &chain, interfaces::Chain::Lock &locked_chain) |
static uint32_t | GetLocktimeForNewTransaction (interfaces::Chain &chain, interfaces::Chain::Lock &locked_chain) |
static int64_t | GetOldestKeyTimeInPool (const std::set< int64_t > &setKeyPool, WalletBatch &batch) |
Variables | |
const std::map< uint64_t, std::string > | WALLET_FLAG_CAVEATS |
static const size_t | OUTPUT_GROUP_MAX_ENTRIES = 10 |
static CCriticalSection | cs_wallets |
static Mutex | g_wallet_release_mutex |
static std::condition_variable | g_wallet_release_cv |
static std::set< CWallet * > | g_unloading_wallet_set |
const uint32_t | BIP32_HARDENED_KEY_LIMIT = 0x80000000 |
bool AddWallet | ( | const std::shared_ptr< CWallet > & | wallet | ) |
std::shared_ptr<CWallet> CreateWallet | ( | interfaces::Chain & | chain, |
const std::string & | name, | ||
std::string & | error, | ||
std::string & | warning, | ||
WalletCreationStatus & | status, | ||
const SecureString & | passphrase, | ||
uint64_t | wallet_creation_flags | ||
) |
std::shared_ptr<CWallet> GetWallet | ( | const std::string & | name | ) |
std::vector<std::shared_ptr<CWallet> > GetWallets | ( | ) |
|
static |
bool HasWallets | ( | ) |
std::shared_ptr<CWallet> LoadWallet | ( | interfaces::Chain & | chain, |
const WalletLocation & | location, | ||
std::string & | error, | ||
std::string & | warning | ||
) |
std::shared_ptr<CWallet> LoadWallet | ( | interfaces::Chain & | chain, |
const std::string & | name, | ||
std::string & | error, | ||
std::string & | warning | ||
) |
void MaybeResendWalletTxs | ( | ) |
Called periodically by the schedule thread. Prompts individual wallets to resend their transactions. Actual rebroadcast schedule is managed by the wallets themselves.
|
static |
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.
const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000 |
|
static |
|
static |
|
static |
|
static |
|
static |
const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS |