backend: keep blocks history at least 7 days

This commit is contained in:
Tanguy Pruvot 2018-05-08 23:49:53 +02:00
parent b114a1c66f
commit ca974e661f

View file

@ -35,8 +35,7 @@ function BackendQuickClean()
foreach($coins as $coin) foreach($coins as $coin)
{ {
$delay = time() - 24*60*60; $delay = time() - 7*24*60*60;
if ($coin->symbol=='DCR') $delay = time() - 7*24*60*60;
$id = dboscalar("select id from blocks where coin_id=$coin->id and time<$delay and $id = dboscalar("select id from blocks where coin_id=$coin->id and time<$delay and
id not in (select blockid from earnings where coinid=$coin->id) id not in (select blockid from earnings where coinid=$coin->id)