- Addr string
- Conn net.PacketConn
- Passive bool // Don't respond to queries.
-}
-
-type serverStats struct {
- NumGoodNodes int
- NumNodes int
- NumOutstandingTransactions int
-}
-
-func (s *Server) Stats() (ss serverStats) {
+ Addr string // Listen address. Used if Conn is nil.
+ Conn net.PacketConn
+ // Don't respond to queries from other nodes.
+ Passive bool
+}
+
+type ServerStats struct {
+ // Count of nodes in the node table that responded to our last query or
+ // haven't yet been queried.
+ GoodNodes int
+ // Count of nodes in the node table.
+ Nodes int
+ // Transactions awaiting a response.
+ OutstandingTransactions int
+ // Individual announce_peer requests that got a success response.
+ ConfirmedAnnounces int
+}
+
+// Returns statistics for the server.
+func (s *Server) Stats() (ss ServerStats) {