Skip to content

Commit

Permalink
Fixed subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraef authored and Sergio Valverde committed Dec 8, 2020
1 parent 080a715 commit fcb091c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions network-libp2p/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl Network {
for topic in msg.topics.iter() {
if let Some(output) = state.gossip_topics.get(&topic) {
// let peer = Self::get_peer(peer_id).unwrap();
// output.send((msg, peer));
output.send((msg, peer));
} else {
log::warn!("Unknown topic hash: {:?}", topic);
}
Expand Down Expand Up @@ -436,12 +436,10 @@ impl NetworkInterface for Network {
})
.await;

let test = rx.map(|(msg, peer)|
{
let item = msg.data;
( item , peer)
}).into_inner();
Box::new(test)
Box::new(rx.map(|(msg, peer)| {
let item: <T as Topic>::Item = Deserialize::deserialize_from_vec(&msg.data);
(item, peer)
}))
}

async fn publish<T>(&self, topic: &T, item: <T as Topic>::Item) -> Result<(), Self::Error>
Expand Down

0 comments on commit fcb091c

Please sign in to comment.