fixed issue where ut_metadata thought it should have the whole torrent metadata whereas it actually only has the info dictionary part of the metadata
This commit is contained in:
parent
57b57522bb
commit
4f002d7a76
6
index.js
6
index.js
|
@ -179,13 +179,13 @@ module.exports = function (metadata) {
|
|||
// check hash
|
||||
var info
|
||||
try {
|
||||
info = bncode.encode(bncode.decode(this.metadata).info)
|
||||
info = bncode.encode(bncode.decode(this.metadata))
|
||||
} catch (err) {
|
||||
// if buffer fails to decode, then data was corrupt
|
||||
return this._failedMetadata()
|
||||
}
|
||||
if (sha1(info) === this._infoHash.toString('hex')) {
|
||||
this._gotMetadata(this.metadata)
|
||||
if (info && sha1(info) === this._infoHash.toString('hex')) {
|
||||
this._gotMetadata(bncode.encode({ info : bncode.decode(this.metadata) }))
|
||||
} else {
|
||||
this._failedMetadata()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue