| 612 | return out; |
| 613 | } |
| 614 | bool isEncrypted(const std::string& wallet_name) override |
| 615 | { |
| 616 | auto wallets{GetWallets(m_context)}; |
| 617 | auto it = std::find_if(wallets.begin(), wallets.end(), [&](std::shared_ptr<CWallet> w){ return w->GetName() == wallet_name; }); |
| 618 | if (it != wallets.end()) return (*it)->HasEncryptionKeys(); |
| 619 | |
| 620 | // Unloaded wallet, read db |
| 621 | DatabaseOptions options; |
| 622 | options.require_existing = true; |
| 623 | DatabaseStatus status; |
| 624 | bilingual_str error; |
| 625 | auto db = MakeWalletDatabase(wallet_name, options, status, error); |
| 626 | if (!db && status == wallet::DatabaseStatus::FAILED_LEGACY_DISABLED) { |
| 627 | options.require_format = wallet::DatabaseFormat::BERKELEY_RO; |
| 628 | db = MakeWalletDatabase(wallet_name, options, status, error); |
| 629 | } |
| 630 | if (!db) return false; |
| 631 | return WalletBatch(*db).IsEncrypted(); |
| 632 | } |
| 633 | std::string getWalletDir() override |
| 634 | { |
| 635 | return fs::PathToString(GetWalletDir()); |
no test coverage detected