Skip to content

Commit

Permalink
fix: prevent tari_mining_node from being able to start without a vali…
Browse files Browse the repository at this point in the history
…d address for pool mining
  • Loading branch information
StriderDM committed Oct 8, 2021
1 parent 7384201 commit bbce643
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion applications/tari_mining_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["The Tari Development Community"]
description = "The tari mining node implementation"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "0.11.0"
version = "0.11.1"
edition = "2018"

[dependencies]
Expand Down
8 changes: 7 additions & 1 deletion applications/tari_mining_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ use std::{
time::Instant,
};
use tari_app_grpc::tari_rpc::{base_node_client::BaseNodeClient, wallet_client::WalletClient};
use tari_app_utilities::{initialization::init_configuration, utilities::ExitCodes};
use tari_app_utilities::{
initialization::init_configuration,
utilities::{ExitCodes, ExitCodes::ConfigError},
};
use tari_common::{configuration::bootstrap::ApplicationType, ConfigBootstrap, DefaultConfigLoader, GlobalConfig};
use tari_core::blocks::BlockHeader;
use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::hex::Hex};
use tokio::{runtime::Runtime, time::sleep};
use tonic::transport::Channel;
use utils::{coinbase_request, extract_outputs_and_kernels};
Expand Down Expand Up @@ -82,6 +86,8 @@ async fn main_inner() -> Result<(), ExitCodes> {
if !config.mining_wallet_address.is_empty() && !config.mining_pool_address.is_empty() {
let url = config.mining_pool_address.clone();
let mut miner_address = config.mining_wallet_address.clone();
let _ = RistrettoPublicKey::from_hex(&miner_address)
.map_err(|_| ConfigError("Miner is not configured with a valid wallet address.".to_string()))?;
if !config.mining_worker_name.is_empty() {
miner_address += &format!("{}{}", ".", &config.mining_worker_name);
}
Expand Down

0 comments on commit bbce643

Please sign in to comment.