Skip to content

Commit fcb091c

Browse files
jgraefSergio Valverde
authored andcommitted
Fixed subscribe
1 parent 080a715 commit fcb091c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

network-libp2p/src/network.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl Network {
306306
for topic in msg.topics.iter() {
307307
if let Some(output) = state.gossip_topics.get(&topic) {
308308
// let peer = Self::get_peer(peer_id).unwrap();
309-
// output.send((msg, peer));
309+
output.send((msg, peer));
310310
} else {
311311
log::warn!("Unknown topic hash: {:?}", topic);
312312
}
@@ -436,12 +436,10 @@ impl NetworkInterface for Network {
436436
})
437437
.await;
438438

439-
let test = rx.map(|(msg, peer)|
440-
{
441-
let item = msg.data;
442-
( item , peer)
443-
}).into_inner();
444-
Box::new(test)
439+
Box::new(rx.map(|(msg, peer)| {
440+
let item: <T as Topic>::Item = Deserialize::deserialize_from_vec(&msg.data);
441+
(item, peer)
442+
}))
445443
}
446444

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

0 commit comments

Comments
 (0)