From 65e1bbb6bac1b8c1bbdc2b22179b78d875148f9d Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 17 Jul 2014 16:04:43 +1000 Subject: [PATCH] Show piece counts for peers in status page Lets me visually check that connections agree on number of pieces. --- connection.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index d7654e7d..2b471910 100644 --- a/connection.go +++ b/connection.go @@ -54,8 +54,9 @@ func (cn *connection) completedString() string { if cn.PeerPieces == nil { return "?" } - f := float32(cn.piecesPeerHasCount()) / float32(cn.totalPiecesCount()) - return fmt.Sprintf("%d%%", int(f*100)) + // f := float32(cn.piecesPeerHasCount()) / float32(cn.totalPiecesCount()) + // return fmt.Sprintf("%d%%", int(f*100)) + return fmt.Sprintf("%d/%d", cn.piecesPeerHasCount(), cn.totalPiecesCount()) } func (cn *connection) totalPiecesCount() int {