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/ping.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/ping.go')
-rw-r--r-- | swarm/pss/ping.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swarm/pss/ping.go b/swarm/pss/ping.go index 2ef072918..ff635f40a 100644 --- a/swarm/pss/ping.go +++ b/swarm/pss/ping.go @@ -19,6 +19,7 @@ package pss import ( + "context" "errors" "time" @@ -40,7 +41,7 @@ type Ping struct { InC chan bool // optional, report back to calling code } -func (p *Ping) pingHandler(msg interface{}) error { +func (p *Ping) pingHandler(ctx context.Context, msg interface{}) error { var pingmsg *PingMsg var ok bool if pingmsg, ok = msg.(*PingMsg); !ok { @@ -80,7 +81,7 @@ func NewPingProtocol(ping *Ping) *p2p.Protocol { for { select { case ispong := <-ping.OutC: - pp.Send(&PingMsg{ + pp.Send(context.TODO(), &PingMsg{ Created: time.Now(), Pong: ispong, }) |