Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Commit f0a4c63

Browse files
committed
swarm/network, swarm/storage, swarm:tracing: Minor cleanup
1 parent 9333e24 commit f0a4c63

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

swarm/network/stream/peer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ type Peer struct {
6666
// on creating a new client in offered hashes handler.
6767
clientParams map[Stream]*clientParams
6868
quit chan struct{}
69-
spans sync.Map
7069
}
7170

7271
type WrappedPriorityMsg struct {
@@ -84,7 +83,6 @@ func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer {
8483
clients: make(map[Stream]*client),
8584
clientParams: make(map[Stream]*clientParams),
8685
quit: make(chan struct{}),
87-
//spans: sync.Map{},
8886
}
8987
ctx, cancel := context.WithCancel(context.Background())
9088
go p.pq.Run(ctx, func(i interface{}) {

swarm/network/stream/stream.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import (
3535
"github.com/ethereum/go-ethereum/swarm/network/stream/intervals"
3636
"github.com/ethereum/go-ethereum/swarm/state"
3737
"github.com/ethereum/go-ethereum/swarm/storage"
38-
39-
opentracing "github.com/opentracing/opentracing-go"
4038
)
4139

4240
const (
@@ -97,7 +95,6 @@ type Registry struct {
9795
spec *protocols.Spec //this protocol's spec
9896
balance protocols.Balance //implements protocols.Balance, for accounting
9997
prices protocols.Prices //implements protocols.Prices, provides prices to accounting
100-
spans sync.Map
10198
}
10299

103100
// RegistryOptions holds optional values for NewRegistry constructor.
@@ -887,10 +884,6 @@ func (r *Registry) Start(server *p2p.Server) error {
887884
}
888885

889886
func (r *Registry) Stop() error {
890-
r.spans.Range(func(k, v interface{}) bool {
891-
v.(opentracing.Span).Finish()
892-
return true
893-
})
894887
return nil
895888
}
896889

swarm/storage/netstore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//// Copyright 2016 The go-ethereum Authors
1+
// Copyright 2016 The go-ethereum Authors
22
// This file is part of the go-ethereum library.
33
//
44
// The go-ethereum library is free software: you can redistribute it and/or modify

swarm/tracing/tracing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func ShiftSpanByKey(k string) opentracing.Span {
166166
// FinishSpans calls `Finish()` on all stored spans
167167
// It should be called on instance shutdown
168168
func FinishSpans() {
169-
store.spans.Range(func(k, v interface{}) bool {
169+
store.spans.Range(func(_, v interface{}) bool {
170170
v.(opentracing.Span).Finish()
171171
return true
172172
})

0 commit comments

Comments
 (0)