mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge 43981ee2c8 into merged_master (Bitcoin PR #21127)
This commit is contained in:
commit
29d002046c
1 changed files with 12 additions and 8 deletions
|
|
@ -584,13 +584,6 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
|||
CHDChain chain;
|
||||
ssValue >> chain;
|
||||
pwallet->GetOrCreateLegacyScriptPubKeyMan()->LoadHDChain(chain);
|
||||
} else if (strType == DBKeys::FLAGS) {
|
||||
uint64_t flags;
|
||||
ssValue >> flags;
|
||||
if (!pwallet->LoadWalletFlags(flags)) {
|
||||
strErr = "Error reading wallet database: Unknown non-tolerable wallet flags found";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (strType == "onlinekey")
|
||||
{
|
||||
|
|
@ -739,7 +732,8 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
|||
wss.fIsEncrypted = true;
|
||||
} else if (strType != DBKeys::BESTBLOCK && strType != DBKeys::BESTBLOCK_NOMERKLE &&
|
||||
strType != DBKeys::MINVERSION && strType != DBKeys::ACENTRY &&
|
||||
strType != DBKeys::VERSION && strType != DBKeys::SETTINGS) {
|
||||
strType != DBKeys::VERSION && strType != DBKeys::SETTINGS &&
|
||||
strType != DBKeys::FLAGS) {
|
||||
wss.m_unknown_records++;
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
|
|
@ -784,6 +778,16 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
|||
pwallet->LoadMinVersion(nMinVersion);
|
||||
}
|
||||
|
||||
// Load wallet flags, so they are known when processing other records.
|
||||
// The FLAGS key is absent during wallet creation.
|
||||
uint64_t flags;
|
||||
if (m_batch->Read(DBKeys::FLAGS, flags)) {
|
||||
if (!pwallet->LoadWalletFlags(flags)) {
|
||||
pwallet->WalletLogPrintf("Error reading wallet database: Unknown non-tolerable wallet flags found\n");
|
||||
return DBErrors::CORRUPT;
|
||||
}
|
||||
}
|
||||
|
||||
// Get cursor
|
||||
if (!m_batch->StartCursor())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue