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 9, 2024
1 parent 3a59af2 commit 866b840
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 @@ -551,7 +551,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 @@ -1930,11 +1929,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 @@ -2075,9 +2069,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 @@ -3521,7 +3512,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 866b840

Please sign in to comment.