storage: remove previous value size from quota when appropriate

This commit is contained in:
Adrien Beraud committed 2025-05-22 11:53:05 -04:00
1 parent a2dff6a123
commit 3e407e65fa
1 file changed
+1 -1
+1 -1
View File
@@ -224,7 +224,7 @@ Storage::store(const InfoHash& id, const Sp<Value>& value, time_point created, t
//DHT_LOG.DEBUG("Updating %s -> %s", id.toString().c_str(), value->toString().c_str());
// clear quota for previous value
if (it->store_bucket)
it->store_bucket->erase(id, *value, it->expiration);
it->store_bucket->erase(id, *it->data, it->expiration);
it->expiration = expiration;
// update quota for new value
it->store_bucket = sb;