fixing config access in share class for archive purge
This commit is contained in:
parent
993ddaf3bc
commit
fdf97c8832
@ -165,12 +165,12 @@ class Share {
|
||||
$aBlock = $this->block->getBlock($aLastBlock['height'] - $this->config['archive']['maxrounds']);
|
||||
// Now that we know our block, remove those shares
|
||||
$stmt = $this->mysqli->prepare("DELETE FROM $this->tableArchive WHERE block_id < ? AND time < DATE_SUB(now(), INTERVAL ? MINUTE)");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $aBlock['id'], $config['archive']['maxage']) && $stmt->execute())
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $aBlock['id'], $this->config['archive']['maxage']) && $stmt->execute())
|
||||
return true;
|
||||
} else {
|
||||
// We are not running pplns, so we just need to keep shares of the past <interval> minutes
|
||||
$stmt = $this->mysqli->prepare("DELETE FROM $this->tableArchive WHERE time < DATE_SUB(now(), INTERVAL ? MINUTE)");
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $config['archive']['maxage']) && $stmt->execute())
|
||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $this->config['archive']['maxage']) && $stmt->execute())
|
||||
return true;
|
||||
}
|
||||
// Catchall
|
||||
|
||||
Loading…
Reference in New Issue
Block a user