]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add torrent.InfoHash type alias
authorMatt Joiner <anacrolix@gmail.com>
Sat, 7 Jul 2018 01:32:52 +0000 (11:32 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 7 Jul 2018 01:32:52 +0000 (11:32 +1000)
client.go
misc.go

index 6aaf5669055583f2726c180976ad2130ea11aa9f..d4f8640e68e6883ab9f8b42131c06fe515a6d558 100644 (file)
--- a/client.go
+++ b/client.go
@@ -64,7 +64,7 @@ type Client struct {
        // through legitimate channels.
        dopplegangerAddrs map[string]struct{}
        badPeerIPs        map[string]struct{}
-       torrents          map[metainfo.Hash]*Torrent
+       torrents          map[InfoHash]*Torrent
 
        acceptLimiter map[ipStr]int
 }
diff --git a/misc.go b/misc.go
index bab40e1721952fd936e1625d4004e8c41ec44db2..ecf91788fcd748dbe9fb6d597f739a170b56d5d5 100644 (file)
--- a/misc.go
+++ b/misc.go
@@ -169,4 +169,7 @@ func min(as ...int64) int64 {
 
 var unlimited = rate.NewLimiter(rate.Inf, 0)
 
-type pieceIndex = int
+type (
+       pieceIndex = int
+       InfoHash   = metainfo.Hash
+)