Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
//! 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::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> LoadWallet(interfaces::Chain &chain, | ||||
interfaces::Chain &chain, | |||||
const WalletLocation &location, | const WalletLocation &location, | ||||
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 CreateWallet(interfaces::Chain &chain, | ||||
interfaces::Chain &chain, | |||||
const SecureString &passphrase, | const SecureString &passphrase, | ||||
uint64_t wallet_creation_flags, | uint64_t wallet_creation_flags, | ||||
const std::string &name, bilingual_str &error, | const std::string &name, 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 | ||||
▲ Show 20 Lines • Show All 1,299 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Mark a transaction (and it in-wallet descendants) as abandoned so its | * Mark a transaction (and it in-wallet descendants) as abandoned so its | ||||
* inputs may be respent. | * inputs may be respent. | ||||
*/ | */ | ||||
bool AbandonTransaction(const TxId &txid); | bool AbandonTransaction(const TxId &txid); | ||||
//! Verify wallet naming and perform salvage on the wallet if required | //! Verify wallet naming and perform salvage on the wallet if required | ||||
static bool Verify(const CChainParams &chainParams, | static bool Verify(interfaces::Chain &chain, const WalletLocation &location, | ||||
interfaces::Chain &chain, const WalletLocation &location, | |||||
bilingual_str &error_string, | bilingual_str &error_string, | ||||
std::vector<bilingual_str> &warnings); | std::vector<bilingual_str> &warnings); | ||||
/** | /** | ||||
* Initializes the wallet, returns a new CWallet instance or a null pointer | * Initializes the wallet, returns a new CWallet instance or a null pointer | ||||
* in case of an error. | * in case of an error. | ||||
*/ | */ | ||||
static std::shared_ptr<CWallet> | static std::shared_ptr<CWallet> | ||||
CreateWalletFromFile(const CChainParams &chainParams, | CreateWalletFromFile(interfaces::Chain &chain, | ||||
interfaces::Chain &chain, | |||||
const WalletLocation &location, bilingual_str &error, | const WalletLocation &location, bilingual_str &error, | ||||
std::vector<bilingual_str> &warnings, | std::vector<bilingual_str> &warnings, | ||||
uint64_t wallet_creation_flags = 0); | uint64_t wallet_creation_flags = 0); | ||||
/** | /** | ||||
* Wallet post-init setup | * Wallet post-init setup | ||||
* Gives the wallet a chance to register repetitive tasks and complete | * Gives the wallet a chance to register repetitive tasks and complete | ||||
* post-init tasks | * post-init tasks | ||||
▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines |