diff --git a/src/models/torrent_file.rs b/src/models/torrent_file.rs index a7e98bb4..aba633c5 100644 --- a/src/models/torrent_file.rs +++ b/src/models/torrent_file.rs @@ -216,6 +216,7 @@ impl TorrentInfoDictionary { // a torrent file has a root hash or a pieces key, but not both. if root_hash > 0 { + // If `root_hash` is true the `pieces` field contains the `root hash` info_dict.root_hash = Some(pieces.to_owned()); } else { let buffer = into_bytes(pieces).expect("variable `torrent_info.pieces` is not a valid hex string"); diff --git a/src/services/torrent_file.rs b/src/services/torrent_file.rs index 1a1dd933..338ba6e6 100644 --- a/src/services/torrent_file.rs +++ b/src/services/torrent_file.rs @@ -14,7 +14,7 @@ pub struct CreateTorrentRequest { pub pieces: String, pub piece_length: i64, pub private: Option, - pub root_hash: i64, + pub root_hash: i64, // True (1) if it's a BEP 30 torrent. pub files: Vec, // Other fields of the root level metainfo dictionary pub announce_urls: Vec>,