resync check
This commit is contained in:
2
util.php
2
util.php
@@ -463,9 +463,11 @@ foreach($r as $x){
|
|||||||
$balance=round(($rec-$spent),8);
|
$balance=round(($rec-$spent),8);
|
||||||
if($x['balance']!=$balance){
|
if($x['balance']!=$balance){
|
||||||
echo "rec: $rec, spent: $spent, bal: $x[balance], should be: $balance - $x[id] $x[public_key]\n";
|
echo "rec: $rec, spent: $spent, bal: $x[balance], should be: $balance - $x[id] $x[public_key]\n";
|
||||||
|
if(trim($argv[2])!="check") {
|
||||||
$db->run("UPDATE accounts SET balance=:bal WHERE id=:id",[":id"=>$x['id'], ":bal"=>$balance]);
|
$db->run("UPDATE accounts SET balance=:bal WHERE id=:id",[":id"=>$x['id'], ":bal"=>$balance]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$db->exec("UNLOCK TABLES");
|
$db->exec("UNLOCK TABLES");
|
||||||
echo "All done";
|
echo "All done";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user