]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Show piece counts for peers in status page
authorMatt Joiner <anacrolix@gmail.com>
Thu, 17 Jul 2014 06:04:43 +0000 (16:04 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 17 Jul 2014 06:04:43 +0000 (16:04 +1000)
Lets me visually check that connections agree on number of pieces.

connection.go

index d7654e7d0ea98e939d03b116935d031cfc2a7490..2b47191024551685ae26359c1a80649e2f6016d1 100644 (file)
@@ -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 {