Skip to content

Commit

Permalink
Restructuring p2p handlers (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirugan committed Apr 30, 2024
1 parent 72dfa3a commit efa8774
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 135 deletions.
9 changes: 2 additions & 7 deletions p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,8 @@ func (s *Service) SubscribeToTopic(topic string) (chan []byte, func(), error) {
}

func (s *Service) PublishOnTopic(topic string) error {
t, joinErr := s.joinTopic(topic)
if joinErr != nil {
return joinErr
}
_ = t

return nil
_, err := s.joinTopic(topic)
return err
}

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

0 comments on commit efa8774

Please sign in to comment.