Skip to content

Commit 267da51

Browse files
committed
wallet, interfaces: Use BERKELEY_RO in isEncrypted
Since isEncrypted opens a file to search for a particular record, it needs to use BERKELEY_RO when opening a legacy wallet.
1 parent 0b5ca71 commit 267da51

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/interfaces.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,10 @@ class WalletLoaderImpl : public WalletLoader
643643
DatabaseStatus status;
644644
bilingual_str error;
645645
auto db = MakeWalletDatabase(wallet_name, options, status, error);
646+
if (!db && status == wallet::DatabaseStatus::FAILED_LEGACY_DISABLED) {
647+
options.require_format = wallet::DatabaseFormat::BERKELEY_RO;
648+
db = MakeWalletDatabase(wallet_name, options, status, error);
649+
}
646650
if (!db) return false;
647651
return WalletBatch(*db).IsEncrypted();
648652
}

0 commit comments

Comments
 (0)