pub fn broadcast_block(&self, b: &core::Block) {
		let peers = self.connected_peers();
		let mut count = 0;
		for p in peers.iter().take(8) {
			let p = p.read().unwrap();
			if p.is_connected() {
				if let Err(e) = p.send_block(b) {
					debug!(LOGGER, "Error sending block to peer: {:?}", e);
				} else {
					count += 1;
				}
			}
		}
		debug!(LOGGER, "Broadcasted block {} to {} peers.", b.header.height, count);
	}
/// Broadcasts the provided block to PEER_PREFERRED_COUNT of our peers.
/// We may be connected to PEER_MAX_COUNT peers so we only
/// want to broadcast to a random subset of peers.
/// A peer implementation may drop the broadcast request
/// if it knows the remote peer already has the block.
Broadcasts the provided block to PEER_PREFERRED_COUNT of our peers.
We may be connected to PEER_MAX_COUNT peers so we only
want to broadcast to a random subset of peers.
A peer implementation may drop the broadcast request
if it knows the remote peer already has the block.
Broadcasts the provided block to PEER_PREFERRED_COUNT of our peers . We may be connected to PEER_MAX_COUNT peers so we only want to broadcast to a random subset of peers . A peer implementation may drop the broadcast request if it knows the remote peer already has the block .
pub fn broadcast_block(&self, b: &core::Block) {
		let peers = self.connected_peers();
		let mut count = 0;
		for p in peers.iter().take(8) {
			let p = p.read().unwrap();
			if p.is_connected() {
				if let Err(e) = p.send_block(b) {
					debug!(LOGGER, "Error sending block to peer: {:?}", e);
				} else {
					count += 1;
				}
			}
		}
		debug!(LOGGER, "Broadcasted block {} to {} peers.", b.header.height, count);
	}
pub fn broadcast_block ( & self , b : & core :: Block ) { let peers = self . connected_peers ( ) ; let mut count = 0 ; for p in peers . iter ( ) . take ( 8 ) { let p = p . read ( ) . unwrap ( ) ; if p . is_connected ( ) { if let Err ( e ) = p . send_block ( b ) { debug ! ( LOGGER " " e ) ; } else { count += 1 ; } } } debug ! ( LOGGER " " b header height count ) ; }
Broadcasts the provided block to PEER_PREFERRED_COUNT of our peers.
Broadcasts the provided block to PEER_PREFERRED_COUNT of our peers .
&self
b
&core::Block