Skip to content

Commit df9c926

Browse files
committed
chore: drop unused EraseOldDBData()
1 parent c9cb9a6 commit df9c926

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/evo/deterministicmns.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,32 +1187,6 @@ void CDeterministicMNManager::CleanupCache(int nHeight)
11871187

11881188
}
11891189

1190-
[[nodiscard]] static bool EraseOldDBData(CDBWrapper& db, const std::vector<std::string>& db_key_prefixes)
1191-
{
1192-
bool erased{false};
1193-
for(const auto& db_key_prefix : db_key_prefixes) {
1194-
CDBBatch batch{db};
1195-
std::unique_ptr<CDBIterator> it{db.NewIterator()};
1196-
std::pair firstKey{db_key_prefix, uint256()};
1197-
it->Seek(firstKey);
1198-
while (it->Valid()) {
1199-
decltype(firstKey) curKey;
1200-
if (!it->GetKey(curKey) || std::get<0>(curKey) != db_key_prefix) {
1201-
break;
1202-
}
1203-
batch.Erase(curKey);
1204-
erased = true;
1205-
it->Next();
1206-
}
1207-
if (erased) {
1208-
LogPrintf("CDeterministicMNManager::%s -- updating db...\n", __func__);
1209-
db.WriteBatch(batch);
1210-
LogPrintf("CDeterministicMNManager::%s -- done cleaning old data for %s\n", __func__, db_key_prefix);
1211-
}
1212-
}
1213-
return erased;
1214-
}
1215-
12161190
template <typename ProTx>
12171191
static bool CheckService(const ProTx& proTx, TxValidationState& state)
12181192
{

0 commit comments

Comments
 (0)