From 0d0fbe7b6f47c4ccea8d7dbbb6d4b0f6516c2324 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 bed64f53d..05e81c002 100644 --- a/server.go +++ b/server.go @@ -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 @@ -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 @@ -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) @@ -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{}),