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
return string(h[:])
}
+func (h Hash) String() string {
+ return h.HexString()
+}
+
func (h Hash) HexString() string {
return fmt.Sprintf("%x", h[:])
}
// 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()