fn on_extrinsics(&mut self, who: PeerId, extrinsics: message::Transactions<B::Extrinsic>) {
		// Accept extrinsics only when fully synced
		if self.sync.status().state != SyncState::Idle {
			trace!(target: "sync", "{} Ignoring extrinsics while syncing", who);
			return;
		}
		trace!(target: "sync", "Received {} extrinsics from {}", extrinsics.len(), who);
		if let Some(ref mut peer) = self.context_data.peers.get_mut(&who) {
			for t in extrinsics {
				if let Some(hash) = self.transaction_pool.import(&t) {
					peer.known_extrinsics.insert(hash);
				} else {
					trace!(target: "sync", "Extrinsic rejected");
				}
			}
		}
	}
/// Called when peer sends us new extrinsics
Called when peer sends us new extrinsics
Called when peer sends us new extrinsics
fn on_extrinsics(&mut self, who: PeerId, extrinsics: message::Transactions<B::Extrinsic>) {
		// Accept extrinsics only when fully synced
		if self.sync.status().state != SyncState::Idle {
			trace!(target: "sync", "{} Ignoring extrinsics while syncing", who);
			return;
		}
		trace!(target: "sync", "Received {} extrinsics from {}", extrinsics.len(), who);
		if let Some(ref mut peer) = self.context_data.peers.get_mut(&who) {
			for t in extrinsics {
				if let Some(hash) = self.transaction_pool.import(&t) {
					peer.known_extrinsics.insert(hash);
				} else {
					trace!(target: "sync", "Extrinsic rejected");
				}
			}
		}
	}
fn on_extrinsics ( & mut self , who : PeerId , extrinsics : message :: Transactions < B :: Extrinsic > ) { // Accept extrinsics only when fully synced if self . sync . status ( ) . state != SyncState :: Idle { trace ! ( target " " " " who ) ; return ; } trace ! ( target " " " " extrinsics len ( ) who ) ; if let Some ( ref mut peer ) = self . context_data . peers . get_mut ( & who ) { for t in extrinsics { if let Some ( hash ) = self . transaction_pool . import ( & t ) { peer . known_extrinsics . insert ( hash ) ; } else { trace ! ( target " " " " ) ; } } } }
Called when peer sends us new extrinsics
Called when peer sends us new extrinsics
&mut self
who
PeerId
extrinsics
message::Transactions<B::Extrinsic>
&mut self
who
PeerId
extrinsics
message::Transactions<B::Extrinsic>