From 866b840166dd878d07173f77c84087a90fb88d5a Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 9 May 2024 18:43:27 -0500 Subject: [PATCH] server: Remove unused query chan and handler. 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. --- server.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/server.go b/server.go index 73b4ef2995..61daf3b70c 100644 --- a/server.go +++ b/server.go @@ -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 @@ -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 @@ -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) @@ -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{}),