Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions applications/minotari_node/src/grpc/base_node_grpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use tari_core::{
consensus::{emission::Emission, ConsensusManager, NetworkConsensus},
iterators::NonOverlappingIntegerPairIter,
mempool::{service::LocalMempoolService, TxStorageResponse},
proof_of_work::PowAlgorithm,
proof_of_work::{Difficulty, PowAlgorithm},
transactions::{
generate_coinbase_with_wallet_output,
transaction_components::{
Expand Down Expand Up @@ -424,7 +424,8 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
e.to_string()
);
obscure_error_if_true(report_error_flag, Status::internal(e.to_string()))
})?;
})
.unwrap_or(Difficulty::min());
let target_time = constants.pow_target_block_interval(PowAlgorithm::Sha3x);
let estimated_hash_rate = target_difficulty.as_u64().checked_div(target_time).unwrap_or(0);
self.data_cache
Expand All @@ -450,7 +451,8 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
e.to_string()
);
obscure_error_if_true(report_error_flag, Status::internal(e.to_string()))
})?;
})
.unwrap_or(Difficulty::min());
let target_time = constants.pow_target_block_interval(PowAlgorithm::RandomXM);
let estimated_hash_rate = target_difficulty.as_u64().checked_div(target_time).unwrap_or(0);
self.data_cache
Expand All @@ -477,7 +479,8 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
e.to_string()
);
obscure_error_if_true(report_error_flag, Status::internal(e.to_string()))
})?;
})
.unwrap_or(Difficulty::min());
let target_time = constants.pow_target_block_interval(PowAlgorithm::RandomXT);
let estimated_hash_rate = target_difficulty.as_u64().checked_div(target_time).unwrap_or(0);
self.data_cache
Expand Down
Loading