From 2166bf1ec0e709bd07045b695370a5469fbf4d58 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 1 Feb 2018 18:45:58 +1100 Subject: [PATCH] Some changes to status output --- connection.go | 4 ++-- torrent.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/connection.go b/connection.go index 0c0d7a91..f53402b4 100644 --- a/connection.go +++ b/connection.go @@ -205,10 +205,10 @@ func (cn *connection) String() string { func (cn *connection) WriteStatus(w io.Writer, t *Torrent) { // \t isn't preserved in
 blocks?
 	fmt.Fprintf(w, "%-40s: %s-%s\n", cn.PeerID, cn.localAddr(), cn.remoteAddr())
-	fmt.Fprintf(w, "    last msg: %s, connected: %s, last useful chunk: %s\n",
+	fmt.Fprintf(w, "    last msg: %s, connected: %s, last helpful: %s\n",
 		eventAgeString(cn.lastMessageReceived),
 		eventAgeString(cn.completedHandshake),
-		eventAgeString(cn.lastUsefulChunkReceived))
+		eventAgeString(cn.lastHelpful()))
 	fmt.Fprintf(w,
 		"    %s completed, %d pieces touched, good chunks: %d/%d-%d reqq: %d-%d, flags: %s\n",
 		cn.completedString(),
diff --git a/torrent.go b/torrent.go
index 0814dcee..6a332e0e 100644
--- a/torrent.go
+++ b/torrent.go
@@ -557,7 +557,7 @@ func (t *Torrent) writeStatus(w io.Writer) {
 		}
 	}())
 	if t.info != nil {
-		fmt.Fprintf(w, "Num Pieces: %d\n", t.numPieces())
+		fmt.Fprintf(w, "Num Pieces: %d (%d completed)\n", t.numPieces(), t.numPiecesCompleted())
 		fmt.Fprint(w, "Piece States:")
 		for _, psr := range t.pieceStateRuns() {
 			w.Write([]byte(" "))
-- 
2.48.1