Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
//! Explicitly unload and delete the wallet. | //! Explicitly unload and delete the wallet. | ||||
//! Blocks the current thread after signaling the unload intent so that all | //! Blocks the current thread after signaling the unload intent so that all | ||||
//! wallet clients release the wallet. | //! wallet clients release the wallet. | ||||
//! Note that, when blocking is not required, the wallet is implicitly unloaded | //! Note that, when blocking is not required, the wallet is implicitly unloaded | ||||
//! by the shared pointer deleter. | //! by the shared pointer deleter. | ||||
void UnloadWallet(std::shared_ptr<CWallet> &&wallet); | void UnloadWallet(std::shared_ptr<CWallet> &&wallet); | ||||
bool AddWallet(const std::shared_ptr<CWallet> &wallet); | bool AddWallet(const std::shared_ptr<CWallet> &wallet); | ||||
bool RemoveWallet(const std::shared_ptr<CWallet> &wallet); | bool RemoveWallet(const std::shared_ptr<CWallet> &wallet, | ||||
std::optional<bool> load_on_start, | |||||
std::vector<bilingual_str> &warnings); | |||||
bool RemoveWallet(const std::shared_ptr<CWallet> &wallet, | |||||
std::optional<bool> load_on_start); | |||||
std::vector<std::shared_ptr<CWallet>> GetWallets(); | std::vector<std::shared_ptr<CWallet>> GetWallets(); | ||||
std::shared_ptr<CWallet> GetWallet(const std::string &name); | std::shared_ptr<CWallet> GetWallet(const std::string &name); | ||||
std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | std::shared_ptr<CWallet> | ||||
interfaces::Chain &chain, | LoadWallet(const CChainParams &chainParams, interfaces::Chain &chain, | ||||
const WalletLocation &location, | const WalletLocation &location, std::optional<bool> load_on_start, | ||||
bilingual_str &error, | bilingual_str &error, std::vector<bilingual_str> &warnings); | ||||
std::vector<bilingual_str> &warnings); | |||||
std::unique_ptr<interfaces::Handler> HandleLoadWallet(LoadWalletFn load_wallet); | std::unique_ptr<interfaces::Handler> HandleLoadWallet(LoadWalletFn load_wallet); | ||||
enum class WalletCreationStatus { SUCCESS, CREATION_FAILED, ENCRYPTION_FAILED }; | enum class WalletCreationStatus { SUCCESS, CREATION_FAILED, ENCRYPTION_FAILED }; | ||||
WalletCreationStatus CreateWallet(const CChainParams ¶ms, | WalletCreationStatus | ||||
interfaces::Chain &chain, | CreateWallet(const CChainParams ¶ms, interfaces::Chain &chain, | ||||
const SecureString &passphrase, | const SecureString &passphrase, uint64_t wallet_creation_flags, | ||||
uint64_t wallet_creation_flags, | const std::string &name, std::optional<bool> load_on_start, | ||||
const std::string &name, bilingual_str &error, | bilingual_str &error, std::vector<bilingual_str> &warnings, | ||||
std::vector<bilingual_str> &warnings, | |||||
std::shared_ptr<CWallet> &result); | std::shared_ptr<CWallet> &result); | ||||
//! -paytxfee default | //! -paytxfee default | ||||
constexpr Amount DEFAULT_PAY_TX_FEE = Amount::zero(); | constexpr Amount DEFAULT_PAY_TX_FEE = Amount::zero(); | ||||
//! -fallbackfee default | //! -fallbackfee default | ||||
static const Amount DEFAULT_FALLBACK_FEE = Amount::zero(); | static const Amount DEFAULT_FALLBACK_FEE = Amount::zero(); | ||||
//! -mintxfee default | //! -mintxfee default | ||||
static const Amount DEFAULT_TRANSACTION_MINFEE_PER_KB = 1000 * SATOSHI; | static const Amount DEFAULT_TRANSACTION_MINFEE_PER_KB = 1000 * SATOSHI; | ||||
/** | /** | ||||
* maximum fee increase allowed to do partial spend avoidance, even for nodes | * maximum fee increase allowed to do partial spend avoidance, even for nodes | ||||
▲ Show 20 Lines • Show All 1,545 Lines • ▼ Show 20 Lines | int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | ||||
const CWallet *wallet, | const CWallet *wallet, | ||||
bool use_max_sig = false) | bool use_max_sig = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(wallet->cs_wallet); | EXCLUSIVE_LOCKS_REQUIRED(wallet->cs_wallet); | ||||
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, | ||||
const CWallet *wallet, | const CWallet *wallet, | ||||
const std::vector<CTxOut> &txouts, | const std::vector<CTxOut> &txouts, | ||||
bool use_max_sig = false); | bool use_max_sig = false); | ||||
//! Add wallet name to persistent configuration so it will be loaded on startup. | |||||
bool AddWalletSetting(interfaces::Chain &chain, const std::string &wallet_name); | |||||
//! Remove wallet name from persistent configuration so it will not be loaded on | |||||
//! startup. | |||||
bool RemoveWalletSetting(interfaces::Chain &chain, | |||||
const std::string &wallet_name); | |||||
#endif // BITCOIN_WALLET_WALLET_H | #endif // BITCOIN_WALLET_WALLET_H |