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.
clientParams map[Stream]*clientParams
quit chan struct{}
spans sync.Map
}
type WrappedPriorityMsg struct {
@ -84,7 +83,6 @@ func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer {
clients: make(map[Stream]*client),
clientParams: make(map[Stream]*clientParams),
quit: make(chan struct{}),
//spans: sync.Map{},
}
ctx, cancel := context.WithCancel(context.Background())
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/state"
"github.com/ethereum/go-ethereum/swarm/storage"
opentracing "github.com/opentracing/opentracing-go"
)
const (
@ -97,7 +95,6 @@ type Registry struct {
spec *protocols.Spec //this protocol's spec
balance protocols.Balance //implements protocols.Balance, for accounting
prices protocols.Prices //implements protocols.Prices, provides prices to accounting
spans sync.Map
}
// RegistryOptions holds optional values for NewRegistry constructor.
@ -887,10 +884,6 @@ func (r *Registry) Start(server *p2p.Server) error {
}
func (r *Registry) Stop() error {
r.spans.Range(func(k, v interface{}) bool {
v.(opentracing.Span).Finish()
return true
})
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.
//
// 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
// It should be called on instance shutdown
func FinishSpans() {
store.spans.Range(func(k, v interface{}) bool {
store.spans.Range(func(_, v interface{}) bool {
v.(opentracing.Span).Finish()
return true
})