Skip to content

Commit d601a89

Browse files
committed
chore: remove unused allows
1 parent 56f7b15 commit d601a89

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

crates/net/network/src/state.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,9 @@ impl NetworkState {
182182
/// > the total number of peers) using the `NewBlock` message.
183183
///
184184
/// See also <https://github.com/ethereum/devp2p/blob/master/caps/eth.md>
185-
#[allow(unused_variables)]
186185
pub(crate) fn announce_new_block(&mut self, msg: NewBlockMessage) {
187186
// send a `NewBlock` message to a fraction of the connected peers (square root of the total
188187
// number of peers)
189-
#[allow(unreachable_code)]
190188
let num_propagate = (self.active_peers.len() as f64).sqrt() as u64 + 1;
191189

192190
let number = msg.block.block.header.number;
@@ -226,7 +224,6 @@ impl NetworkState {
226224

227225
/// Completes the block propagation process started in [`NetworkState::announce_new_block()`]
228226
/// but sending `NewBlockHash` broadcast to all peers that haven't seen it yet.
229-
#[allow(unused_variables)]
230227
pub(crate) fn announce_new_block_hash(&mut self, msg: NewBlockMessage) {
231228
let number = msg.block.block.header.number;
232229
let hashes = NewBlockHashes(vec![BlockHashNumber { hash: msg.hash, number }]);
@@ -263,7 +260,6 @@ impl NetworkState {
263260
/// Invoked after a `NewBlock` message was received by the peer.
264261
///
265262
/// This will keep track of blocks we know a peer has
266-
#[allow(unused_variables)]
267263
pub(crate) fn on_new_block(&mut self, peer_id: PeerId, hash: B256) {
268264
// Mark the blocks as seen
269265
if let Some(peer) = self.active_peers.get_mut(&peer_id) {
@@ -272,7 +268,6 @@ impl NetworkState {
272268
}
273269

274270
/// Invoked for a `NewBlockHashes` broadcast message.
275-
#[allow(unused_variables)]
276271
pub(crate) fn on_new_block_hashes(&mut self, peer_id: PeerId, hashes: Vec<BlockHashNumber>) {
277272
// Mark the blocks as seen
278273
if let Some(peer) = self.active_peers.get_mut(&peer_id) {
@@ -365,7 +360,6 @@ impl NetworkState {
365360
///
366361
/// Caution: this will replace an already pending response. It's the responsibility of the
367362
/// caller to select the peer.
368-
#[allow(unused_variables)]
369363
fn handle_block_request(&mut self, peer: PeerId, request: BlockRequest) {
370364
if let Some(ref mut peer) = self.active_peers.get_mut(&peer) {
371365
let (request, response) = match request {

0 commit comments

Comments
 (0)