future block

This commit is contained in:
Arionum
2018-04-01 16:28:08 +03:00
parent 7573e64034
commit a13c7285fd
5 changed files with 58 additions and 21 deletions

View File

@@ -122,6 +122,8 @@ elseif($q=="submitBlock"){
$current=$block->current();
// block already in the blockchain
if($current['id']==$data['id']) api_echo("block-ok");
if($data['date']>time()+30) api_err("block in the future");
if($current['height']==$data['height']&&$current['id']!=$data['id']){
// different forks, same height
$accept_new=false;
@@ -186,7 +188,7 @@ elseif($q=="submitBlock"){
_log('['.$_SERVER['REMOTE_ADDR']."] block ok, repropagating - $data[height]");
// send it to all our peers
system("php propagate.php block '$data[id]' > /dev/null 2>&1 &");
// system("php propagate.php block '$data[id]' > /dev/null 2>&1 &");
api_echo("block-ok");
}
// return the current block, used in syncing