diff options
Diffstat (limited to 'swarm/pss/pss.go')
-rw-r--r-- | swarm/pss/pss.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/swarm/pss/pss.go b/swarm/pss/pss.go index 0a8d757d8..0d02c9b8d 100644 --- a/swarm/pss/pss.go +++ b/swarm/pss/pss.go @@ -415,11 +415,11 @@ func (p *Pss) handlePssMsg(ctx context.Context, msg interface{}) error { } isRecipient := p.isSelfPossibleRecipient(pssmsg, isProx) if !isRecipient { - log.Trace("pss was for someone else :'( ... forwarding", "pss", common.ToHex(p.BaseAddr()), "prox", isProx) + log.Trace("pss msg forwarding ===>", "pss", common.ToHex(p.BaseAddr()), "prox", isProx) return p.enqueue(pssmsg) } - log.Trace("pss for us, yay! ... let's process!", "pss", common.ToHex(p.BaseAddr()), "prox", isProx, "raw", isRaw, "topic", label(pssmsg.Payload.Topic[:])) + log.Trace("pss msg processing <===", "pss", common.ToHex(p.BaseAddr()), "prox", isProx, "raw", isRaw, "topic", label(pssmsg.Payload.Topic[:])) if err := p.process(pssmsg, isRaw, isProx); err != nil { qerr := p.enqueue(pssmsg) if qerr != nil { @@ -463,14 +463,11 @@ func (p *Pss) process(pssmsg *PssMsg, raw bool, prox bool) error { payload = recvmsg.Payload } - if len(pssmsg.To) < addressLength { - if err := p.enqueue(pssmsg); err != nil { - return err - } + if len(pssmsg.To) < addressLength || prox { + err = p.enqueue(pssmsg) } p.executeHandlers(psstopic, payload, from, raw, prox, asymmetric, keyid) - - return nil + return err } // copy all registered handlers for respective topic in order to avoid data race or deadlock |