Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Oct 24, 2023
1 parent 6c30f02 commit df1a4ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions base_layer/core/src/proof_of_work/monero_rx/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ pub fn verify_header(header: &BlockHeader) -> Result<MoneroPowData, MergeMineErr
let expected_merge_mining_hash = header.merge_mining_hash();
let extra_field = ExtraField::try_parse(&monero_data.coinbase_tx.prefix.extra)
.map_err(|_| MergeMineError::DeserializeError("Invalid extra field".to_string()))?;
// Check that the Tari MM hash is found in the monero coinbase transaction
// and that only 1 tari header is found
// Check that the Tari MM hash is found in the Monero coinbase transaction
// and that only 1 Tari header is found

let mut is_found = false;
let mut already_seen_mmfield = false;
Expand Down Expand Up @@ -222,7 +222,8 @@ pub fn insert_merge_mining_tag_into_block<T: AsRef<[u8]>>(
)));
}
// When we insert the merge mining tag, we need to make sure that the extra field is valid.
let mut extra_field = parse_extra_field_truncate_on_error(&block.miner_tx.prefix.extra);
let mut extra_field = ExtraField::try_parse(&block.miner_tx.prefix.extra)
.map_err(|_| MergeMineError::DeserializeError("Invalid extra field".to_string()))?;

// Adding more than one merge mining tag is not allowed
for item in &extra_field.0 {
Expand Down

0 comments on commit df1a4ad

Please sign in to comment.