Skip to content

Commit efa8774

Browse files
authored
Restructuring p2p handlers (#1702)
1 parent 72dfa3a commit efa8774

File tree

2 files changed

+173
-135
lines changed

2 files changed

+173
-135
lines changed

Diff for: p2p/p2p.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,8 @@ func (s *Service) SubscribeToTopic(topic string) (chan []byte, func(), error) {
336336
}
337337

338338
func (s *Service) PublishOnTopic(topic string) error {
339-
t, joinErr := s.joinTopic(topic)
340-
if joinErr != nil {
341-
return joinErr
342-
}
343-
_ = t
344-
345-
return nil
339+
_, err := s.joinTopic(topic)
340+
return err
346341
}
347342

348343
func (s *Service) SetProtocolHandler(pid protocol.ID, handler func(network.Stream)) {

0 commit comments

Comments
 (0)