diff --git a/src/maker/server.rs b/src/maker/server.rs index 8bc8e551..edd6d86d 100644 --- a/src/maker/server.rs +++ b/src/maker/server.rs @@ -36,7 +36,6 @@ use crate::{ rpc::start_rpc_server, }, protocol::messages::{DnsMetadata, DnsRequest, TakerToMakerMessage}, - taker::api::MINER_FEE, utill::{get_tor_addrs, read_message, send_message, ConnectionType, HEART_BEAT_INTERVAL}, wallet::WalletError, }; @@ -232,7 +231,7 @@ fn setup_fidelity_bond(maker: &Arc, maker_address: &str) -> Result<(), Ma highest_proof.bond.outpoint, i, bond.amount.to_sat(), - current_height - bond.lock_time.to_consensus_u32(), + bond.lock_time.to_consensus_u32() - current_height, wallet_read.calculate_bond_value(i)?.to_sat() ); log::info!("Bond amount : {:?}", bond.amount.to_sat()); @@ -264,7 +263,7 @@ fn setup_fidelity_bond(maker: &Arc, maker_address: &str) -> Result<(), Ma let mut sleep_multiplier = 0; log::info!("No active Fidelity Bonds found. Creating one."); log::info!("Fidelity value chosen = {:?} sats", amount.to_sat()); - log::info!("Fidelity Tx fee = {} sats", MINER_FEE); + log::info!("Fidelity Tx fee = 300 sats"); log::info!( "Fidelity timelock {} blocks", maker.config.fidelity_timelock diff --git a/src/taker/api.rs b/src/taker/api.rs index 27f85a27..cd787d30 100644 --- a/src/taker/api.rs +++ b/src/taker/api.rs @@ -2037,12 +2037,17 @@ impl Taker { } #[cfg(feature = "tor")] ConnectionType::TOR => { - let directory_hs_path_str = "/tmp/tor-rust-directory/hs-dir/hostname".to_string(); - let mut directory_file = std::fs::File::open(directory_hs_path_str)?; - let mut directory_onion_addr = String::new(); - directory_file.read_to_string(&mut directory_onion_addr)?; - directory_onion_addr.pop(); - format!("{}:{}", directory_onion_addr, 8080) + if cfg!(feature = "integration-test") { + let directory_hs_path_str = + "/tmp/tor-rust-directory/hs-dir/hostname".to_string(); + let mut directory_file = std::fs::File::open(directory_hs_path_str)?; + let mut directory_onion_addr = String::new(); + directory_file.read_to_string(&mut directory_onion_addr)?; + directory_onion_addr.pop(); + format!("{}:{}", directory_onion_addr, 8080) + } else { + self.config.directory_server_address.clone() + } } };