diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-07-13 23:40:28 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-07-13 23:40:28 +0800 |
commit | 7c9314f231a7ddffbbbc5fec16c65519a0121eeb (patch) | |
tree | dbc4021b66ee8968ad747036741fac7e1b972a39 /swarm/pss/pss.go | |
parent | f7d3678c28c4b92e45a458e4785bd0f1cdc20e34 (diff) | |
download | dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.tar dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.tar.gz dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.tar.bz2 dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.tar.lz dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.tar.xz dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.tar.zst dexon-7c9314f231a7ddffbbbc5fec16c65519a0121eeb.zip |
swarm: integrate OpenTracing; propagate ctx to internal APIs (#17169)
* swarm: propagate ctx, enable opentracing
* swarm/tracing: log error when tracing is misconfigured
Diffstat (limited to 'swarm/pss/pss.go')
-rw-r--r-- | swarm/pss/pss.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/swarm/pss/pss.go b/swarm/pss/pss.go index dd081e93a..5c060b248 100644 --- a/swarm/pss/pss.go +++ b/swarm/pss/pss.go @@ -18,6 +18,7 @@ package pss import ( "bytes" + "context" "crypto/ecdsa" "crypto/rand" "errors" @@ -71,7 +72,7 @@ type senderPeer interface { Info() *p2p.PeerInfo ID() discover.NodeID Address() []byte - Send(interface{}) error + Send(context.Context, interface{}) error } // per-key peer related information @@ -344,7 +345,7 @@ func (p *Pss) getHandlers(topic Topic) map[*Handler]bool { // Check if address partially matches // If yes, it CAN be for us, and we process it // Only passes error to pss protocol handler if payload is not valid pssmsg -func (p *Pss) handlePssMsg(msg interface{}) error { +func (p *Pss) handlePssMsg(ctx context.Context, msg interface{}) error { metrics.GetOrRegisterCounter("pss.handlepssmsg", nil).Inc(1) pssmsg, ok := msg.(*PssMsg) @@ -844,7 +845,7 @@ func (p *Pss) forward(msg *PssMsg) error { p.fwdPoolMu.RUnlock() // attempt to send the message - err := pp.Send(msg) + err := pp.Send(context.TODO(), msg) if err != nil { metrics.GetOrRegisterCounter("pss.pp.send.error", nil).Inc(1) log.Error(err.Error()) |