From: Matt Joiner Date: Thu, 17 Jul 2014 06:04:43 +0000 (+1000) Subject: Show piece counts for peers in status page X-Git-Tag: v1.0.0~1658 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=65e1bbb6bac1b8c1bbdc2b22179b78d875148f9d;p=btrtrc.git Show piece counts for peers in status page Lets me visually check that connections agree on number of pieces. --- 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 {