Skip to content

Commit

Permalink
doc: add some comments for BEP 30 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Sep 19, 2023
1 parent dfdac19 commit 8821346
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/models/torrent_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/services/torrent_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct CreateTorrentRequest {
pub pieces: String,
pub piece_length: i64,
pub private: Option<u8>,
pub root_hash: i64,
pub root_hash: i64, // True (1) if it's a BEP 30 torrent.
pub files: Vec<TorrentFile>,
// Other fields of the root level metainfo dictionary
pub announce_urls: Vec<Vec<String>>,
Expand Down

0 comments on commit 8821346

Please sign in to comment.