BytesInfoHash wasn't actually initializing the info hash
This commit is contained in:
parent
978aa1f0c8
commit
fe80bf2f2f
|
@ -29,7 +29,7 @@ func copyHashSum(dst, src []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func BytesInfoHash(b []byte) (ih InfoHash) {
|
func BytesInfoHash(b []byte) (ih InfoHash) {
|
||||||
if len(b) != len(ih) {
|
if len(b) != len(ih) || copy(ih[:], b) != len(ih) {
|
||||||
panic("bad infohash bytes")
|
panic("bad infohash bytes")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue