swarm/network, swarm/storage, swarm:tracing: Minor cleanup

This commit is contained in:
lash 2019-02-20 07:31:10 +01:00
parent 9333e2409b
commit f0a4c63f7a
4 changed files with 2 additions and 11 deletions

View file

@ -66,7 +66,6 @@ type Peer struct {
// on creating a new client in offered hashes handler. // on creating a new client in offered hashes handler.
clientParams map[Stream]*clientParams clientParams map[Stream]*clientParams
quit chan struct{} quit chan struct{}
spans sync.Map
} }
type WrappedPriorityMsg struct { type WrappedPriorityMsg struct {
@ -84,7 +83,6 @@ func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer {
clients: make(map[Stream]*client), clients: make(map[Stream]*client),
clientParams: make(map[Stream]*clientParams), clientParams: make(map[Stream]*clientParams),
quit: make(chan struct{}), quit: make(chan struct{}),
//spans: sync.Map{},
} }
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
go p.pq.Run(ctx, func(i interface{}) { go p.pq.Run(ctx, func(i interface{}) {

View file

@ -35,8 +35,6 @@ import (
"github.com/ethereum/go-ethereum/swarm/network/stream/intervals" "github.com/ethereum/go-ethereum/swarm/network/stream/intervals"
"github.com/ethereum/go-ethereum/swarm/state" "github.com/ethereum/go-ethereum/swarm/state"
"github.com/ethereum/go-ethereum/swarm/storage" "github.com/ethereum/go-ethereum/swarm/storage"
opentracing "github.com/opentracing/opentracing-go"
) )
const ( const (
@ -97,7 +95,6 @@ type Registry struct {
spec *protocols.Spec //this protocol's spec spec *protocols.Spec //this protocol's spec
balance protocols.Balance //implements protocols.Balance, for accounting balance protocols.Balance //implements protocols.Balance, for accounting
prices protocols.Prices //implements protocols.Prices, provides prices to accounting prices protocols.Prices //implements protocols.Prices, provides prices to accounting
spans sync.Map
} }
// RegistryOptions holds optional values for NewRegistry constructor. // RegistryOptions holds optional values for NewRegistry constructor.
@ -887,10 +884,6 @@ func (r *Registry) Start(server *p2p.Server) error {
} }
func (r *Registry) Stop() error { func (r *Registry) Stop() error {
r.spans.Range(func(k, v interface{}) bool {
v.(opentracing.Span).Finish()
return true
})
return nil return nil
} }

View file

@ -1,4 +1,4 @@
//// Copyright 2016 The go-ethereum Authors // Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library. // This file is part of the go-ethereum library.
// //
// The go-ethereum library is free software: you can redistribute it and/or modify // The go-ethereum library is free software: you can redistribute it and/or modify

View file

@ -166,7 +166,7 @@ func ShiftSpanByKey(k string) opentracing.Span {
// FinishSpans calls `Finish()` on all stored spans // FinishSpans calls `Finish()` on all stored spans
// It should be called on instance shutdown // It should be called on instance shutdown
func FinishSpans() { func FinishSpans() {
store.spans.Range(func(k, v interface{}) bool { store.spans.Range(func(_, v interface{}) bool {
v.(opentracing.Span).Finish() v.(opentracing.Span).Finish()
return true return true
}) })