From 79d800fe92645350f0ee4da856a279013cf030e8 Mon Sep 17 00:00:00 2001
From: Matt Joiner <anacrolix@gmail.com>
Date: Thu, 2 Feb 2017 16:53:19 +1100
Subject: [PATCH] Trivial logging, comment, Stringer changes

---
 connection.go    | 2 +-
 metainfo/hash.go | 4 ++++
 torrent.go       | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/connection.go b/connection.go
index 5b129cec..69e294d5 100644
--- a/connection.go
+++ b/connection.go
@@ -989,7 +989,7 @@ func (c *connection) receiveChunk(msg *pp.Message) {
 	piece.decrementPendingWrites()
 
 	if err != nil {
-		log.Printf("%s: error writing chunk %v: %s", t, req, err)
+		log.Printf("%s (%x): error writing chunk %v: %s", t, t.infoHash, req, err)
 		t.pendRequest(req)
 		t.updatePieceCompletion(int(msg.Index))
 		return
diff --git a/metainfo/hash.go b/metainfo/hash.go
index 6affe62f..d1c832b0 100644
--- a/metainfo/hash.go
+++ b/metainfo/hash.go
@@ -17,6 +17,10 @@ func (h Hash) AsString() string {
 	return string(h[:])
 }
 
+func (h Hash) String() string {
+	return h.HexString()
+}
+
 func (h Hash) HexString() string {
 	return fmt.Sprintf("%x", h[:])
 }
diff --git a/torrent.go b/torrent.go
index d51dbbe7..beff7d21 100644
--- a/torrent.go
+++ b/torrent.go
@@ -1417,6 +1417,7 @@ func (t *Torrent) onIncompletePiece(piece int) {
 	// if you request pieces that you already claim to have. Pruning bad
 	// connections might just remove any connections that aren't treating us
 	// favourably anyway.
+
 	// for c := range t.conns {
 	// 	if c.sentHave(piece) {
 	// 		c.Drop()
-- 
2.51.0