protection
This commit is contained in:
9
peer.php
9
peer.php
@@ -252,7 +252,10 @@ elseif ($q == "currentBlock") {
|
|||||||
} // return a specific block, used in syncing
|
} // return a specific block, used in syncing
|
||||||
elseif ($q == "getBlock") {
|
elseif ($q == "getBlock") {
|
||||||
$height = intval($data['height']);
|
$height = intval($data['height']);
|
||||||
|
if($_config['masternode'] ==true){
|
||||||
|
$current = $block->current();
|
||||||
|
if($current['height']%3==2) api_err('masternode block');
|
||||||
|
}
|
||||||
$export = $block->export("", $height);
|
$export = $block->export("", $height);
|
||||||
if (!$export) {
|
if (!$export) {
|
||||||
api_err("invalid-block");
|
api_err("invalid-block");
|
||||||
@@ -262,6 +265,10 @@ elseif ($q == "getBlock") {
|
|||||||
// returns X block starting at height, used in syncing
|
// returns X block starting at height, used in syncing
|
||||||
|
|
||||||
$height = intval($data['height']);
|
$height = intval($data['height']);
|
||||||
|
if($_config['masternode'] ==true){
|
||||||
|
$current = $block->current();
|
||||||
|
if($current['height']%3==2) api_err('masternode block');
|
||||||
|
}
|
||||||
|
|
||||||
$r = $db->run(
|
$r = $db->run(
|
||||||
"SELECT id,height FROM blocks WHERE height>=:height ORDER by height ASC LIMIT 100",
|
"SELECT id,height FROM blocks WHERE height>=:height ORDER by height ASC LIMIT 100",
|
||||||
|
|||||||
Reference in New Issue
Block a user