Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.h
Show All 31 Lines | |||||
#include <set> | #include <set> | ||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <string> | #include <string> | ||||
#include <utility> | #include <utility> | ||||
#include <vector> | #include <vector> | ||||
#include <boost/signals2/signal.hpp> | #include <boost/signals2/signal.hpp> | ||||
using LoadWalletFn = | |||||
std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>; | |||||
//! 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); | ||||
bool HasWallets(); | bool HasWallets(); | ||||
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(const CChainParams &chainParams, | ||||
interfaces::Chain &chain, | interfaces::Chain &chain, | ||||
const WalletLocation &location, | const WalletLocation &location, | ||||
std::string &error, | std::string &error, | ||||
std::vector<std::string> &warnings); | std::vector<std::string> &warnings); | ||||
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(const CChainParams ¶ms, | ||||
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, std::string &error, | const std::string &name, std::string &error, | ||||
std::vector<std::string> &warnings, | std::vector<std::string> &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; | ||||
//! minimum recommended increment for BIP 125 replacement txs | //! minimum recommended increment for BIP 125 replacement txs | ||||
static const Amount WALLET_INCREMENTAL_RELAY_FEE(5000 * SATOSHI); | static const Amount WALLET_INCREMENTAL_RELAY_FEE(5000 * SATOSHI); | ||||
▲ Show 20 Lines • Show All 1,376 Lines • Show Last 20 Lines |