@@ -617,8 +617,12 @@ class WalletLoaderImpl : public WalletLoader
617617 options.create_flags = wallet_creation_flags;
618618 options.create_passphrase = passphrase;
619619 bilingual_str error;
620- util::Result<std::unique_ptr<Wallet>> wallet{MakeWallet (m_context, CreateWallet (m_context, name, /* load_on_start=*/ true , options, status, error, warnings))};
621- return wallet ? std::move (wallet) : util::Error{error};
620+ std::unique_ptr<Wallet> wallet{MakeWallet (m_context, CreateWallet (m_context, name, /* load_on_start=*/ true , options, status, error, warnings))};
621+ if (wallet) {
622+ return {std::move (wallet)};
623+ } else {
624+ return util::Error{error};
625+ }
622626 }
623627 util::Result<std::unique_ptr<Wallet>> loadWallet (const std::string& name, std::vector<bilingual_str>& warnings) override
624628 {
@@ -627,15 +631,23 @@ class WalletLoaderImpl : public WalletLoader
627631 ReadDatabaseArgs (*m_context.args , options);
628632 options.require_existing = true ;
629633 bilingual_str error;
630- util::Result<std::unique_ptr<Wallet>> wallet{MakeWallet (m_context, LoadWallet (m_context, name, /* load_on_start=*/ true , options, status, error, warnings))};
631- return wallet ? std::move (wallet) : util::Error{error};
634+ std::unique_ptr<Wallet> wallet{MakeWallet (m_context, LoadWallet (m_context, name, /* load_on_start=*/ true , options, status, error, warnings))};
635+ if (wallet) {
636+ return {std::move (wallet)};
637+ } else {
638+ return util::Error{error};
639+ }
632640 }
633641 util::Result<std::unique_ptr<Wallet>> restoreWallet (const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) override
634642 {
635643 DatabaseStatus status;
636644 bilingual_str error;
637- util::Result<std::unique_ptr<Wallet>> wallet{MakeWallet (m_context, RestoreWallet (m_context, backup_file, wallet_name, /* load_on_start=*/ true , status, error, warnings))};
638- return wallet ? std::move (wallet) : util::Error{error};
645+ std::unique_ptr<Wallet> wallet{MakeWallet (m_context, RestoreWallet (m_context, backup_file, wallet_name, /* load_on_start=*/ true , status, error, warnings))};
646+ if (wallet) {
647+ return {std::move (wallet)};
648+ } else {
649+ return util::Error{error};
650+ }
639651 }
640652 std::string getWalletDir () override
641653 {
0 commit comments