diff options
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r-- | src/wallet/walletdb.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 2aee750ced..e5a73af385 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -803,6 +803,12 @@ static DBErrors LoadDescriptorWalletRecords(CWallet* pwallet, DatabaseBatch& bat } pwallet->LoadDescriptorScriptPubKeyMan(id, desc); + // Prior to doing anything with this spkm, verify ID compatibility + if (id != pwallet->GetDescriptorScriptPubKeyMan(desc)->GetID()) { + strErr = "The descriptor ID calculated by the wallet differs from the one in DB"; + return DBErrors::CORRUPT; + } + DescriptorCache cache; // Get key cache for this descriptor |