mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-08 20:09:44 +00:00
small cleanup
This commit is contained in:
parent
291ffe324d
commit
c0a3f7a718
4 changed files with 5 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -11,6 +11,4 @@ pub enum BlockchainManagerCommand {
|
|||
prepped_txs: HashMap<[u8; 32], TransactionVerificationData>,
|
||||
response_tx: oneshot::Sender<Result<bool, anyhow::Error>>,
|
||||
},
|
||||
|
||||
PopBlocks,
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ impl super::BlockchainManager {
|
|||
|
||||
drop(response_tx.send(res));
|
||||
}
|
||||
BlockchainManagerCommand::PopBlocks => todo!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue