Implement LegacyScriptPubKeyMan::DeleteRecords

This commit is contained in:
Andrew Chow
2022-08-25 14:35:28 -04:00
parent 35f428fae6
commit 22401f17e0
4 changed files with 55 additions and 0 deletions

View File

@@ -1964,6 +1964,13 @@ std::optional<MigrationData> LegacyScriptPubKeyMan::MigrateToDescriptor()
return out;
}
bool LegacyScriptPubKeyMan::DeleteRecords()
{
LOCK(cs_KeyStore);
WalletBatch batch(m_storage.GetDatabase());
return batch.EraseRecords(DBKeys::LEGACY_TYPES);
}
util::Result<CTxDestination> DescriptorScriptPubKeyMan::GetNewDestination(const OutputType type)
{
// Returns true if this descriptor supports getting new addresses. Conditions where we may be unable to fetch them (e.g. locked) are caught later