small cleanup

This commit is contained in:
Boog900 2024-09-15 18:08:49 +01:00
parent 291ffe324d
commit c0a3f7a718
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2
4 changed files with 5 additions and 8 deletions

View file

@ -64,14 +64,14 @@ pub async fn handle_incoming_block(
.collect::<Result<_, anyhow::Error>>()
.map_err(IncomingBlockError::InvalidBlock)?;
if !BLOCKS_BEING_HANDLED.get_or_init(|| Mutex::new(HashSet::new())).lock().unwrap().insert(block_hash) {
return Ok(false);
}
let Some(incoming_block_tx) = INCOMING_BLOCK_TX.get() else {
return Ok(false);
};
if !BLOCKS_BEING_HANDLED.get_or_init(|| Mutex::new(HashSet::new())).lock().unwrap().insert(block_hash) {
return Ok(false);
}
let (response_tx, response_rx) = oneshot::channel();
incoming_block_tx

View file

@ -11,6 +11,4 @@ pub enum BlockchainManagerCommand {
prepped_txs: HashMap<[u8; 32], TransactionVerificationData>,
response_tx: oneshot::Sender<Result<bool, anyhow::Error>>,
},
PopBlocks,
}

View file

@ -35,7 +35,6 @@ impl super::BlockchainManager {
drop(response_tx.send(res));
}
BlockchainManagerCommand::PopBlocks => todo!(),
}
}

View file

@ -26,7 +26,7 @@ impl CupratedConfig {
pub fn clearnet_config(&self) -> P2PConfig<ClearNet> {
P2PConfig {
network: Network::Mainnet,
outbound_connections: 64,
outbound_connections: 16,
extra_outbound_connections: 0,
max_inbound_connections: 0,
gray_peers_percent: 0.7,