Added a restriction for IANA domain zones. Users cannot mine them from now on.

This commit is contained in:
Revertron
2021-03-11 01:41:19 +01:00
parent 5d57473122
commit 186f9cb05b
8 changed files with 112 additions and 10 deletions
+6
View File
@@ -355,6 +355,12 @@ fn handle_message(context: Arc<Mutex<Context>>, message: Message, peers: &mut Pe
};
let peer = peers.get_mut_peer(token).unwrap();
peer.set_received_block(block.index);
if let Some(transaction) = &block.transaction {
if context.lock().unwrap().iana.has_hash(&transaction.identity.to_string()) {
// This peer has mined some of the forbidden zones
return State::Banned;
}
}
let context = context.clone();
let peers_count = peers.get_peers_active_count();
thread::spawn(move || {