Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 403 Lines • ▼ Show 20 Lines | public: | ||||
return m_wallet->CanGetAddresses(); | return m_wallet->CanGetAddresses(); | ||||
} | } | ||||
bool privateKeysDisabled() override { | bool privateKeysDisabled() override { | ||||
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS); | return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS); | ||||
} | } | ||||
Amount getDefaultMaxTxFee() override { | Amount getDefaultMaxTxFee() override { | ||||
return m_wallet->m_default_max_tx_fee; | return m_wallet->m_default_max_tx_fee; | ||||
} | } | ||||
void remove() override { RemoveWallet(m_wallet); } | void remove() override { | ||||
RemoveWallet(m_wallet, false /* load_on_start */); | |||||
} | |||||
bool isLegacy() override { return m_wallet->IsLegacy(); } | bool isLegacy() override { return m_wallet->IsLegacy(); } | ||||
std::unique_ptr<Handler> handleUnload(UnloadFn fn) override { | std::unique_ptr<Handler> handleUnload(UnloadFn fn) override { | ||||
return MakeHandler(m_wallet->NotifyUnload.connect(fn)); | return MakeHandler(m_wallet->NotifyUnload.connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> | std::unique_ptr<Handler> | ||||
handleShowProgress(ShowProgressFn fn) override { | handleShowProgress(ShowProgressFn fn) override { | ||||
return MakeHandler(m_wallet->ShowProgress.connect(fn)); | return MakeHandler(m_wallet->ShowProgress.connect(fn)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | public: | ||||
//! WalletClient methods | //! WalletClient methods | ||||
std::unique_ptr<Wallet> | std::unique_ptr<Wallet> | ||||
createWallet(const CChainParams ¶ms, const std::string &name, | createWallet(const CChainParams ¶ms, const std::string &name, | ||||
const SecureString &passphrase, | const SecureString &passphrase, | ||||
uint64_t wallet_creation_flags, | uint64_t wallet_creation_flags, | ||||
WalletCreationStatus &status, bilingual_str &error, | WalletCreationStatus &status, bilingual_str &error, | ||||
std::vector<bilingual_str> &warnings) override { | std::vector<bilingual_str> &warnings) override { | ||||
std::shared_ptr<CWallet> wallet; | std::shared_ptr<CWallet> wallet; | ||||
status = CreateWallet(params, *m_context.chain, passphrase, | status = CreateWallet( | ||||
wallet_creation_flags, name, error, warnings, | params, *m_context.chain, passphrase, wallet_creation_flags, | ||||
wallet); | name, true /* load_on_start */, error, warnings, wallet); | ||||
return MakeWallet(std::move(wallet)); | return MakeWallet(std::move(wallet)); | ||||
} | } | ||||
std::unique_ptr<Wallet> | std::unique_ptr<Wallet> | ||||
loadWallet(const CChainParams ¶ms, const std::string &name, | loadWallet(const CChainParams ¶ms, const std::string &name, | ||||
bilingual_str &error, | bilingual_str &error, | ||||
std::vector<bilingual_str> &warnings) override { | std::vector<bilingual_str> &warnings) override { | ||||
return MakeWallet(LoadWallet(params, *m_context.chain, | return MakeWallet( | ||||
WalletLocation(name), error, | LoadWallet(params, *m_context.chain, WalletLocation(name), | ||||
warnings)); | true /* load_on_start */, error, warnings)); | ||||
} | } | ||||
std::string getWalletDir() override { return GetWalletDir().string(); } | std::string getWalletDir() override { return GetWalletDir().string(); } | ||||
std::vector<std::string> listWalletDir() override { | std::vector<std::string> listWalletDir() override { | ||||
std::vector<std::string> paths; | std::vector<std::string> paths; | ||||
for (auto &path : ListWalletDir()) { | for (auto &path : ListWalletDir()) { | ||||
paths.push_back(path.string()); | paths.push_back(path.string()); | ||||
} | } | ||||
return paths; | return paths; | ||||
Show All 34 Lines |