filter
This commit is contained in:
@@ -267,10 +267,10 @@ $this->reset_fails_masternodes($mn_winner, $height, $hash);
|
|||||||
}
|
}
|
||||||
}elseif($height>=80458){
|
}elseif($height>=80458){
|
||||||
$type=$height%2;
|
$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;
|
$blks=0;
|
||||||
$total_time=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++) {
|
for ($i=0;$i<19;$i++) {
|
||||||
$ctype=$blk[$i+1]['height']%2;
|
$ctype=$blk[$i+1]['height']%2;
|
||||||
$time=$blk[$i]['date']-$blk[$i+1]['date'];
|
$time=$blk[$i]['date']-$blk[$i+1]['date'];
|
||||||
|
|||||||
@@ -378,6 +378,10 @@ class Transaction
|
|||||||
_log("The Masternode IP is invalid", 3);
|
_log("The Masternode IP is invalid", 3);
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
util.php
2
util.php
@@ -93,7 +93,7 @@ elseif ($cmd == 'block-time') {
|
|||||||
}
|
}
|
||||||
$time = $t - $x['date'];
|
$time = $t - $x['date'];
|
||||||
$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'];
|
$end = $x['date'];
|
||||||
}
|
}
|
||||||
echo "Average block time: ".ceil(($start - $end) / 100)." seconds\n";
|
echo "Average block time: ".ceil(($start - $end) / 100)." seconds\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user