paranoid and blacklist
This commit is contained in:
@@ -276,7 +276,7 @@ class Block
|
||||
// before mnn hf
|
||||
if ($height<80000) {
|
||||
// elapsed time between the last 20 blocks
|
||||
$first = $db->row("SELECT `date` FROM blocks ORDER by height DESC LIMIT $limit,1");
|
||||
$first = $db->row("SELECT `date` FROM blocks ORDER by height DESC LIMIT :limit,1",[":limit"=>$limit]);
|
||||
$time = $current['date'] - $first['date'];
|
||||
|
||||
// avg block time
|
||||
@@ -566,8 +566,8 @@ class Block
|
||||
}
|
||||
_log("We have masternodes to blacklist - $tem", 2);
|
||||
$ban=$db->run(
|
||||
"SELECT public_key, blacklist, fails, last_won FROM masternode WHERE status=1 AND blacklist<:current AND height<:start ORDER by last_won ASC, public_key ASC LIMIT 0,$tem",
|
||||
[":current"=>$last['height'], ":start"=>$last['height']-360]
|
||||
"SELECT public_key, blacklist, fails, last_won FROM masternode WHERE status=1 AND blacklist<:current AND height<:start ORDER by last_won ASC, public_key ASC LIMIT 0,:limit",
|
||||
[":current"=>$last['height'], ":start"=>$last['height']-360, ":limit"=>$tem]
|
||||
);
|
||||
_log(json_encode($ban));
|
||||
$i=0;
|
||||
@@ -689,8 +689,8 @@ class Block
|
||||
$tem=floor(($time-$last_time)/600);
|
||||
}
|
||||
$winner=$db->single(
|
||||
"SELECT public_key FROM masternode WHERE status=1 AND blacklist<:current AND height<:start ORDER by last_won ASC, public_key ASC LIMIT $tem,1",
|
||||
[":current"=>$current_height, ":start"=>$current_height-360]
|
||||
"SELECT public_key FROM masternode WHERE status=1 AND blacklist<:current AND height<:start ORDER by last_won ASC, public_key ASC LIMIT :tem,1",
|
||||
[":current"=>$current_height, ":start"=>$current_height-360, ":tem"=>$tem]
|
||||
);
|
||||
_log("Moving to the next masternode - $tem - $winner", 1);
|
||||
// if all masternodes are dead, give the block to gpu
|
||||
|
||||
@@ -38,6 +38,10 @@ $_config['allowed_hosts'] = [
|
||||
'127.0.0.1',
|
||||
];
|
||||
|
||||
// Disable transactions and block repropagation
|
||||
$_config['disable_repropagation'] = false;
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Peer Configuration
|
||||
@@ -65,6 +69,9 @@ $_config['max_mempool_rebroadcast'] = 5000;
|
||||
// The number of blocks between rebroadcasting transactions
|
||||
$_config['sanity_rebroadcast_height'] = 30;
|
||||
|
||||
// Block accepting transfers from addresses blacklisted by the Arionum devs
|
||||
$_config['use_official_blacklist'] = true;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanity Configuration
|
||||
|
||||
@@ -218,10 +218,21 @@ class Transaction
|
||||
public function add_mempool($x, $peer = "")
|
||||
{
|
||||
global $db;
|
||||
global $_config;
|
||||
$block = new Block();
|
||||
if ($x['version']>110) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($_config['use_official_blacklist']!==false) {
|
||||
$blacklisted=[
|
||||
"PZ8Tyr4Nx8MHsRAGMpZmZ6TWY63dXWSCvVQcHHCNLfiP9LmzWhhpCHx39Bhc67P5HMQM9cctEFvcsUdgrkGqy18taz9ZMrAGtq7NhBYpQ4ZTHkKYiZDaSUqQ", //faucet abuser
|
||||
"PZ8Tyr4Nx8MHsRAGMpZmZ6TWY63dXWSCxYDeQHk7Ke66UB2Un3UMmMoJ7RF5vDZXihdEXi8gk8ZBRAi35aFrER2ZLX1mgND7sLFXKETGTjRYjoHcuRNiJN1g" // octaex
|
||||
];
|
||||
if (in_array($public_key, $blacklisted)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$current = $block->current();
|
||||
$height = $current['height'];
|
||||
$x['id'] = san($x['id']);
|
||||
|
||||
Reference in New Issue
Block a user