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.
This commit is contained in:
1 parent
f94167512d
commit
130a922980
1 file changed
+4
@@ -643,6 +643,10 @@ public:
|
|||||||
DatabaseStatus status;
|
DatabaseStatus status;
|
||||||
bilingual_str error;
|
bilingual_str error;
|
||||||
auto db = MakeWalletDatabase(wallet_name, options, status, error);
|
auto db = MakeWalletDatabase(wallet_name, options, status, error);
|
||||||
|
if (!db && status == wallet::DatabaseStatus::FAILED_LEGACY_DISABLED) {
|
||||||
|
options.require_format = wallet::DatabaseFormat::BERKELEY_RO;
|
||||||
|
db = MakeWalletDatabase(wallet_name, options, status, error);
|
||||||
|
}
|
||||||
if (!db) return false;
|
if (!db) return false;
|
||||||
return WalletBatch(*db).IsEncrypted();
|
return WalletBatch(*db).IsEncrypted();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user