Skip to content

Commit

Permalink
fix auxiliary bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mojoX911 committed Jan 8, 2025
1 parent 290e643 commit 8784b05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/maker/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -232,7 +231,7 @@ fn setup_fidelity_bond(maker: &Arc<Maker>, 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());
Expand Down Expand Up @@ -264,7 +263,7 @@ fn setup_fidelity_bond(maker: &Arc<Maker>, 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
Expand Down
17 changes: 11 additions & 6 deletions src/taker/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
};

Expand Down

0 comments on commit 8784b05

Please sign in to comment.