diff --git a/sample/examples/configurations/alice.yml b/sample/examples/configurations/alice.yml index 71524ea6..e9d0150a 100644 --- a/sample/examples/configurations/alice.yml +++ b/sample/examples/configurations/alice.yml @@ -7,6 +7,5 @@ bitcoinInfo: storageDirPath: './dlc_sample_alice' networkConfiguration: peerListeningPort: 9000 -network: regtest oracleConfig: host: 'http://localhost:8080/' diff --git a/sample/examples/configurations/bob.yml b/sample/examples/configurations/bob.yml index 40ddd2fb..b5228f94 100644 --- a/sample/examples/configurations/bob.yml +++ b/sample/examples/configurations/bob.yml @@ -7,6 +7,5 @@ bitcoinInfo: storageDirPath: './dlc_sample_bob' networkConfiguration: peerListeningPort: 9001 -network: regtest oracleConfig: host: 'http://localhost:8080/' diff --git a/sample/src/cli.rs b/sample/src/cli.rs index fc1484b7..c76b235f 100644 --- a/sample/src/cli.rs +++ b/sample/src/cli.rs @@ -3,7 +3,6 @@ use crate::hex_utils; use crate::DlcManager; use crate::DlcMessageHandler; use crate::PeerManager; -use bitcoin::network::constants::Network; use bitcoin::secp256k1::PublicKey; use dlc_manager::channel::signed_channel::SignedChannelState; use dlc_manager::channel::signed_channel::SignedChannelStateType; @@ -12,15 +11,13 @@ use dlc_manager::contract::Contract; use dlc_manager::Storage; use dlc_messages::Message as DlcMessage; use hex_utils::{hex_str, to_slice}; -use lightning::ln::msgs::SocketAddress; use serde::Deserialize; use serde_json::Value; use std::convert::TryInto; use std::fs; use std::io; use std::io::{BufRead, Write}; -use std::net::{IpAddr, SocketAddr, ToSocketAddrs}; -use std::str::FromStr; +use std::net::{SocketAddr, ToSocketAddrs}; use std::str::SplitWhitespace; use std::sync::{Arc, Mutex}; use std::time::Duration; @@ -44,7 +41,6 @@ pub struct OracleConfig { #[derive(Debug)] pub struct NetworkConfig { pub peer_listening_port: u16, - pub announced_listen_addr: Option, } #[derive(Debug, Deserialize)] @@ -54,9 +50,6 @@ pub struct Configuration { pub storage_dir_path: String, #[serde(deserialize_with = "deserialize_network_configuration")] pub network_configuration: NetworkConfig, - #[serde(default)] - pub announced_node_name: [u8; 32], - pub network: Network, pub oracle_config: OracleConfig, } @@ -72,29 +65,8 @@ where .try_into() .expect("Could not fit port in u16"); - let announced_listen_addr = if let Some(announced_listen_addr) = val.get("announcedListenAddr") - { - let buf = announced_listen_addr - .as_str() - .expect("Error parsing announcedListenAddr"); - match IpAddr::from_str(buf) { - Ok(IpAddr::V4(a)) => Some(SocketAddress::TcpIpV4 { - addr: a.octets(), - port: peer_listening_port, - }), - Ok(IpAddr::V6(a)) => Some(SocketAddress::TcpIpV6 { - addr: a.octets(), - port: peer_listening_port, - }), - Err(_) => panic!("Failed to parse announced-listen-addr into an IP address"), - } - } else { - None - }; - Ok(NetworkConfig { peer_listening_port, - announced_listen_addr, }) }