Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Feb 13, 2025
1 parent afcbd4a commit 91a4058
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 288 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion applications/minotari_merge_mining_proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ hyper = { version = "0.14.12", features = ["default"] }
jsonrpc = "0.12.0"
log = { version = "0.4.8", features = ["std"] }
markup5ever = "0.12.1"
monero = { version = "0.21.0" , features = ["serde"] }
monero = { version = "0.21.0", features = ["serde"] }
reqwest = { version = "0.11.4", features = ["json"] }
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.57"
Expand All @@ -52,6 +52,7 @@ url = "2.1.1"
scraper = "0.19.0"
toml = "0.8.19"
regex = "1.11.1"
blake2 = "0.10"

[build-dependencies]
tari_features = { path = "../../common/tari_features", version = "1.11.3-pre.0" }
Expand Down
23 changes: 10 additions & 13 deletions applications/minotari_merge_mining_proxy/src/block_template_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use tokio::sync::RwLock;
use tracing::trace;

use crate::{
block_template_protocol::{FinalBlockTemplateData, NewBlockTemplateData},
block_template_manager::{FinalBlockTemplateData, NewBlockTemplateData},
error::MmProxyError,
};

Expand Down Expand Up @@ -118,18 +118,15 @@ impl BlockTemplateRepository {
}

/// Store [FinalBlockTemplateData] at the hash value if the key does not exist.
pub async fn save_final_block_template_if_key_unique(
&self,
merge_mining_hash: Vec<u8>,
block_template: FinalBlockTemplateData,
) {
pub async fn save_final_block_template_if_key_unique(&self, block_template: FinalBlockTemplateData) {
let merge_mining_hash = block_template.aux_chain_mr.to_vec();
let mut b = self.blocks.write().await;
b.entry(merge_mining_hash.clone()).or_insert_with(|| {
trace!(
target: LOG_TARGET,
"Saving final block template with merge mining hash: {:?}",
hex::encode(&merge_mining_hash)
);
b.entry(merge_mining_hash).or_insert_with(|| {
// trace!(
// target: LOG_TARGET,
// "Saving final block template with merge mining hash: {:?}",
// hex::encode(&merge_mining_hash)
// );
BlockRepositoryItem::new(block_template)
});
}
Expand Down Expand Up @@ -323,7 +320,7 @@ pub mod test {
use tari_utilities::ByteArray;

use super::*;
use crate::block_template_protocol::AuxChainMr;
use crate::block_template_manager::AuxChainMr;

fn create_block_template_data() -> FinalBlockTemplateData {
let header = BlockHeader::new(100);
Expand Down
Loading

0 comments on commit 91a4058

Please sign in to comment.