mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 22:52:47 +02:00
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:
@ -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