fn propagate_extrinsics(&mut self) {
		debug!(target: "sync", "Propagating extrinsics");

		// Accept transactions only when fully synced
		if self.sync.status().state != SyncState::Idle {
			return;
		}

		let extrinsics = self.transaction_pool.transactions();
		let mut propagated_to = HashMap::new();
		for (who, peer) in self.context_data.peers.iter_mut() {
			let (hashes, to_send): (Vec<_>, Vec<_>) = extrinsics
				.iter()
				.filter(|&(ref hash, _)| peer.known_extrinsics.insert(hash.clone()))
				.cloned()
				.unzip();

			if !to_send.is_empty() {
				for hash in hashes {
					propagated_to
						.entry(hash)
						.or_insert_with(Vec::new)
						.push(who.to_base58());
				}
				trace!(target: "sync", "Sending {} transactions to {}", to_send.len(), who);
				self.network_chan.send(NetworkMsg::Outgoing(who.clone(), GenericMessage::Transactions(to_send)))
			}
		}
		self.transaction_pool.on_broadcasted(propagated_to);
	}
/// Called when we propagate ready extrinsics to peers.
Called when we propagate ready extrinsics to peers.
Called when we propagate ready extrinsics to peers .
fn propagate_extrinsics(&mut self) {
		debug!(target: "sync", "Propagating extrinsics");
		// Accept transactions only when fully synced
		if self.sync.status().state != SyncState::Idle {
			return;
		}
		let extrinsics = self.transaction_pool.transactions();
		let mut propagated_to = HashMap::new();
		for (who, peer) in self.context_data.peers.iter_mut() {
			let (hashes, to_send): (Vec<_>, Vec<_>) = extrinsics
				.iter()
				.filter(|&(ref hash, _)| peer.known_extrinsics.insert(hash.clone()))
				.cloned()
				.unzip();
			if !to_send.is_empty() {
				for hash in hashes {
					propagated_to
						.entry(hash)
						.or_insert_with(Vec::new)
						.push(who.to_base58());
				}
				trace!(target: "sync", "Sending {} transactions to {}", to_send.len(), who);
				self.network_chan.send(NetworkMsg::Outgoing(who.clone(), GenericMessage::Transactions(to_send)))
			}
		}
		self.transaction_pool.on_broadcasted(propagated_to);
	}
fn propagate_extrinsics ( & mut self ) { debug ! ( target " " " " ) ; // Accept transactions only when fully synced if self . sync . status ( ) . state != SyncState :: Idle { return ; } let extrinsics = self . transaction_pool . transactions ( ) ; let mut propagated_to = HashMap :: new ( ) ; for ( who , peer ) in self . context_data . peers . iter_mut ( ) { let ( hashes , to_send ) : ( Vec < _ > , Vec < _ > ) = extrinsics . iter ( ) . filter ( | & ( ref hash , _ ) | peer . known_extrinsics . insert ( hash . clone ( ) ) ) . cloned ( ) . unzip ( ) ; if ! to_send . is_empty ( ) { for hash in hashes { propagated_to . entry ( hash ) . or_insert_with ( Vec :: new ) . push ( who . to_base58 ( ) ) ; } trace ! ( target " " " " to_send len ( ) who ) ; self . network_chan . send ( NetworkMsg :: Outgoing ( who . clone ( ) , GenericMessage :: Transactions ( to_send ) ) ) } } self . transaction_pool . on_broadcasted ( propagated_to ) ; }
Called when we propagate ready extrinsics to peers.
Called when we propagate ready extrinsics to peers .
&mut self
&mut self