mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
ISDB avoid processing the same fully confirmed block in DB multiple times (#4193)
This commit is contained in:
parent
49ebff2702
commit
2125805a31
@ -161,9 +161,12 @@ void CInstantSendDb::WriteInstantSendLockArchived(CDBBatch& batch, const uint256
|
||||
|
||||
std::unordered_map<uint256, CInstantSendLockPtr> CInstantSendDb::RemoveConfirmedInstantSendLocks(int nUntilHeight)
|
||||
{
|
||||
if (nUntilHeight <= 0) {
|
||||
if (nUntilHeight <= best_confirmed_height) {
|
||||
LogPrint(BCLog::ALL, "CInstantSendDb::%s -- Attempting to confirm height %d, however we've already confirmed height %d. This should never happen.\n", __func__,
|
||||
nUntilHeight, best_confirmed_height);
|
||||
return {};
|
||||
}
|
||||
best_confirmed_height = nUntilHeight;
|
||||
|
||||
auto it = std::unique_ptr<CDBIterator>(db.NewIterator());
|
||||
|
||||
|
@ -42,6 +42,8 @@ class CInstantSendDb
|
||||
private:
|
||||
static const int CURRENT_VERSION = 1;
|
||||
|
||||
int best_confirmed_height{0};
|
||||
|
||||
CDBWrapper& db;
|
||||
|
||||
mutable unordered_lru_cache<uint256, CInstantSendLockPtr, StaticSaltedHasher, 10000> islockCache;
|
||||
|
Loading…
Reference in New Issue
Block a user