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

Commit

Permalink
swarm/network, swarm/storage, swarm:tracing: Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nolash committed Feb 20, 2019
1 parent 9333e24 commit f0a4c63
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions swarm/network/stream/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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{}) {
Expand Down
7 changes: 0 additions & 7 deletions swarm/network/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion swarm/storage/netstore.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion swarm/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit f0a4c63

Please sign in to comment.