This commit is contained in:
Arionum
2018-08-14 05:16:31 +03:00
parent 65e801989d
commit 74190d40ba
3 changed files with 7 additions and 3 deletions

View File

@@ -267,10 +267,10 @@ $this->reset_fails_masternodes($mn_winner, $height, $hash);
}
}elseif($height>=80458){
$type=$height%2;
$current=$db->row("SELECT difficulty from blocks ORDER by height DESC LIMIT 1,1");
$current=$db->row("SELECT difficulty from blocks WHERE height<=:h ORDER by height DESC LIMIT 1,1",[":h"=>$height]);
$blks=0;
$total_time=0;
$blk = $db->run("SELECT `date`, height FROM blocks ORDER by height DESC LIMIT 20");
$blk = $db->run("SELECT `date`, height FROM blocks WHERE height<=:h ORDER by height DESC LIMIT 20",[":h"=>$height]);
for ($i=0;$i<19;$i++) {
$ctype=$blk[$i+1]['height']%2;
$time=$blk[$i]['date']-$blk[$i+1]['date'];

View File

@@ -378,6 +378,10 @@ class Transaction
_log("The Masternode IP is invalid", 3);
return false;
}
$existing=$db->single("SELECT COUNT(1) FROM masternode WHERE public_key=:id or ip=:ip",["id"=>$x['public_key'], ":ip"=>$message]);
if($existing!=0){
return false;
}
}

View File

@@ -93,7 +93,7 @@ elseif ($cmd == 'block-time') {
}
$time = $t - $x['date'];
$t = $x['date'];
echo "$x[height] -> $time\n";
echo "$x[height]\t\t$time\t\t$x[difficulty]\n";
$end = $x['date'];
}
echo "Average block time: ".ceil(($start - $end) / 100)." seconds\n";