mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 21:03:07 +00:00
minor variable refactor
This commit is contained in:
parent
d28f450046
commit
c0494a42f4
@ -736,11 +736,11 @@ func (p *PubSub) GetTopics() []string {
|
||||
// Publish publishes data to the given topic.
|
||||
func (p *PubSub) Publish(topic string, data []byte) error {
|
||||
seqno := p.nextSeqno()
|
||||
hostID := p.host.ID()
|
||||
id := p.host.ID()
|
||||
m := &pb.Message{
|
||||
Data: data,
|
||||
TopicIDs: []string{topic},
|
||||
From: []byte(hostID),
|
||||
From: []byte(id),
|
||||
Seqno: seqno,
|
||||
}
|
||||
if p.signKey != nil {
|
||||
@ -750,7 +750,7 @@ func (p *PubSub) Publish(topic string, data []byte) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
p.publish <- &Message{m, hostID}
|
||||
p.publish <- &Message{m, id}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user