Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Feb 24, 2025
1 parent 9d270b3 commit 0e3ce41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use tari_max_size::MaxSizeBytes;
use tari_utilities::{hex::Hex, ByteArray};

use crate::{
block_template_data::{BlockTemplateData, BlockTemplateDataBuilder, BlockTemplateRepository},
block_template_data::{BlockTemplateData, BlockTemplateDataBuilder},
common::merge_mining,
config::MergeMiningProxyConfig,
error::MmProxyError,
Expand Down Expand Up @@ -227,28 +227,6 @@ impl BlockTemplateManager<'_> {
Ok(NewBlockTemplateData { template, miner_data })
}

/// Check if the height is more than the actual tip. So if still makes sense to compute block for that height.
async fn check_expected_tip(&mut self, height: u64) -> Result<bool, MmProxyError> {
let tip = self
.base_node_client
.clone()
.get_tip_info(grpc::Empty {})
.await?
.into_inner();
let tip_height = tip.metadata.as_ref().map(|m| m.best_block_height).unwrap_or(0);

if height <= tip_height {
warn!(
target: LOG_TARGET,
"Base node received next block (height={}) that has invalidated the block template (height={})",
tip_height,
height
);
return Ok(false);
}
Ok(true)
}

/// Get coinbase transaction for the [template](NewBlockTemplateData).
async fn get_coinbase(
&mut self,
Expand Down
4 changes: 2 additions & 2 deletions applications/minotari_merge_mining_proxy/src/proxy/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ impl InnerService {

let monero_height = json["height"].as_u64().unwrap_or_default();
let monero_hash: Vec<u8> = Hex::from_hex(json["hash"].as_str().unwrap_or_default()).unwrap_or_default();
let mut base_node_height = 0;
let mut base_node_hash = vec![];
let base_node_height;
let base_node_hash;
let mut p2pool_height = 0;
let mut p2pool_hash = vec![];

Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2900,7 +2900,7 @@ fn run_migrations(db: &LMDBDatabase) -> Result<(), ChainStorageError> {
}

let txn = db.write_transaction()?;
info!(target: LOG_TARGET, "Migrated database to version {}", MIGRATION_VERSION);
info!(target: LOG_TARGET, "Migrated database to version {}", n);
lmdb_replace(
&txn,
&db.metadata_db,
Expand Down

0 comments on commit 0e3ce41

Please sign in to comment.