Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Send only best blocks.
  • Loading branch information
tomusdrw committed Apr 17, 2018
commit 704f755dc5c979d58b535a714e3f13f8147ca6af
1 change: 1 addition & 0 deletions substrate/rpc/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ impl<B, E> ChainApi for Chain<B, E> where
fn subscribe_new_head(&self, _metadata: Self::Metadata, subscriber: pubsub::Subscriber<block::Header>) {
self.subscriptions.add(subscriber, |sink| {
let stream = self.client.import_notification_stream()
.filter(|notification| notification.is_new_best)
.map(|notification| Ok(notification.header))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should filter by notification.is_best

.map_err(|e| warn!("Block notification stream error: {:?}", e));
sink
Expand Down