Skip to content

Commit

Permalink
server: Remove unused query chan and handler.
Browse files Browse the repository at this point in the history
This removes the query channel and associated handler and plumbing now
that it is no longer used.

This completes the overall effort to convert all of the code related to
updating and querying the server's peer state to synchronous code that
makes use of a separate mutex to protect it.
  • Loading branch information
davecgh committed May 16, 2024
1 parent 9a746ba commit 78bf86b
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ type server struct {
modifyRebroadcastInv chan interface{}
peerState peerState
banPeers chan *serverPeer
query chan interface{}
relayInv chan relayMsg
broadcast chan broadcastMsg
nat *upnpNAT
Expand Down Expand Up @@ -2088,11 +2087,6 @@ func (s *server) handleBroadcastMsg(state *peerState, bmsg *broadcastMsg) {
})
}

// handleQuery is the central handler for all queries and commands from other
// goroutines related to peer state.
func (s *server) handleQuery(ctx context.Context, state *peerState, querymsg interface{}) {
}

// disconnectPeer attempts to drop the connection of a targeted peer in the
// passed peer list. Targets are identified via usage of the passed
// `compareFunc`, which should return `true` if the passed peer is the target
Expand Down Expand Up @@ -2242,9 +2236,6 @@ out:
case bmsg := <-s.broadcast:
s.handleBroadcastMsg(&s.peerState, &bmsg)

case qmsg := <-s.query:
s.handleQuery(ctx, &s.peerState, qmsg)

case <-ctx.Done():
close(s.quit)

Expand Down Expand Up @@ -3722,7 +3713,6 @@ func newServer(ctx context.Context, listenAddrs []string, db database.DB,
addrManager: amgr,
peerState: makePeerState(),
banPeers: make(chan *serverPeer, cfg.MaxPeers),
query: make(chan interface{}),
relayInv: make(chan relayMsg, cfg.MaxPeers),
broadcast: make(chan broadcastMsg, cfg.MaxPeers),
modifyRebroadcastInv: make(chan interface{}),
Expand Down

0 comments on commit 78bf86b

Please sign in to comment.