Show piece counts for peers in status page

Lets me visually check that connections agree on number of pieces.
This commit is contained in:
Matt Joiner 2014-07-17 16:04:43 +10:00
parent 99bec9ac58
commit 65e1bbb6ba
1 changed files with 3 additions and 2 deletions

View File

@ -54,8 +54,9 @@ func (cn *connection) completedString() string {
if cn.PeerPieces == nil { if cn.PeerPieces == nil {
return "?" return "?"
} }
f := float32(cn.piecesPeerHasCount()) / float32(cn.totalPiecesCount()) // f := float32(cn.piecesPeerHasCount()) / float32(cn.totalPiecesCount())
return fmt.Sprintf("%d%%", int(f*100)) // return fmt.Sprintf("%d%%", int(f*100))
return fmt.Sprintf("%d/%d", cn.piecesPeerHasCount(), cn.totalPiecesCount())
} }
func (cn *connection) totalPiecesCount() int { func (cn *connection) totalPiecesCount() int {