]> Sergey Matveev's repositories - btrtrc.git/blobdiff - torrent.go
Use metainfo.Hash for piece and info hashes
[btrtrc.git] / torrent.go
index 790be4d5c870af336fd473ec73d4b19fabaf4721..993a7e32ef33deb13ee163f19655a7ea4f735581 100644 (file)
@@ -45,7 +45,7 @@ type Torrent struct {
        // announcing, and communicating with peers.
        ceasingNetworking chan struct{}
 
-       infoHash metainfo.InfoHash
+       infoHash metainfo.Hash
        pieces   []piece
        // Values are the piece indices that changed.
        pieceStateChanges *pubsub.PubSub
@@ -656,7 +656,7 @@ func (t *Torrent) pieceLength(piece int) (len_ pp.Integer) {
        return
 }
 
-func (t *Torrent) hashPiece(piece int) (ret pieceSum) {
+func (t *Torrent) hashPiece(piece int) (ret metainfo.Hash) {
        hash := pieceHash.New()
        p := &t.pieces[piece]
        p.waitNoPendingWrites()