mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-19 19:29:45 +02:00
wallet: provide WalletBatch to 'DeleteRecords'
So it can be used within an external db txn context.
This commit is contained in:
@@ -2036,9 +2036,15 @@ std::optional<MigrationData> LegacyDataSPKM::MigrateToDescriptor()
|
||||
}
|
||||
|
||||
bool LegacyDataSPKM::DeleteRecords()
|
||||
{
|
||||
return RunWithinTxn(m_storage.GetDatabase(), /*process_desc=*/"delete legacy records", [&](WalletBatch& batch){
|
||||
return DeleteRecordsWithDB(batch);
|
||||
});
|
||||
}
|
||||
|
||||
bool LegacyDataSPKM::DeleteRecordsWithDB(WalletBatch& batch)
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
WalletBatch batch(m_storage.GetDatabase());
|
||||
return batch.EraseRecords(DBKeys::LEGACY_TYPES);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user