diff --git a/onionr/onionrdaemontools.py b/onionr/onionrdaemontools.py index f269f028..e36945c0 100644 --- a/onionr/onionrdaemontools.py +++ b/onionr/onionrdaemontools.py @@ -65,7 +65,9 @@ class DaemonTools: def cleanOldBlocks(self): '''Delete old blocks if our disk allocation is full/near full''' - if self.daemon._core._utils.storageCounter.isFull(): - - + while self.daemon._core._utils.storageCounter.isFull(): + oldest = self.daemon._core.getBlockList[0] + self.daemon._core._blacklist.addToDB(oldest) + self.daemon._core.removeBlock(oldest) + logger.info('Deleted block: %s' % (oldest,)) self.daemon.decrementThreadCount('cleanOldBlocks') \ No newline at end of file