diff --git a/Cargo.lock b/Cargo.lock index 5c31f22..0bf3d3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3802,8 +3802,8 @@ dependencies = [ [[package]] name = "rustreexo" -version = "0.2.0" -source = "git+https://github.com/Ash-L2L/rustreexo.git?rev=a3ac7d3ebe9749ebd0bb34c709e7616f83d573b3#a3ac7d3ebe9749ebd0bb34c709e7616f83d573b3" +version = "0.1.0" +source = "git+https://github.com/Ash-L2L/rustreexo.git?rev=6e220fd89b33b60d9ab9099926683c3010a62ede#6e220fd89b33b60d9ab9099926683c3010a62ede" dependencies = [ "bitcoin_hashes 0.12.0", "serde", @@ -4393,7 +4393,7 @@ dependencies = [ [[package]] name = "thunder" -version = "0.8.6" +version = "0.8.7" dependencies = [ "anyhow", "bincode", @@ -4429,7 +4429,7 @@ dependencies = [ [[package]] name = "thunder_app" -version = "0.8.6" +version = "0.8.7" dependencies = [ "anyhow", "base64 0.21.7", @@ -4462,7 +4462,7 @@ dependencies = [ [[package]] name = "thunder_app_cli" -version = "0.8.6" +version = "0.8.7" dependencies = [ "anyhow", "bip300301", @@ -4475,7 +4475,7 @@ dependencies = [ [[package]] name = "thunder_app_rpc_api" -version = "0.8.6" +version = "0.8.7" dependencies = [ "bip300301", "jsonrpsee", diff --git a/Cargo.toml b/Cargo.toml index 1609029..b12cd33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ authors = [ "Nikita Chashchinskii " ] edition = "2021" -version = "0.8.6" +version = "0.8.7" [workspace.dependencies.bip300301] git = "https://github.com/Ash-L2L/bip300301.git" @@ -21,7 +21,7 @@ rev = "64568dee7b89fe8c021226f10b17a18fe3386871" [workspace.dependencies.rustreexo] git = "https://github.com/Ash-L2L/rustreexo.git" -rev = "a3ac7d3ebe9749ebd0bb34c709e7616f83d573b3" +rev = "6e220fd89b33b60d9ab9099926683c3010a62ede" [profile.release] # lto = "fat" diff --git a/lib/net/mod.rs b/lib/net/mod.rs index 2e506e6..f99a7cc 100644 --- a/lib/net/mod.rs +++ b/lib/net/mod.rs @@ -167,7 +167,21 @@ impl Net { let active_peers = Arc::new(RwLock::new(HashMap::new())); let mut rwtxn = env.write_txn()?; let known_peers = - env.create_database(&mut rwtxn, Some("known_peers"))?; + match env.open_database(&rwtxn, Some("known_peers"))? { + Some(known_peers) => known_peers, + None => { + let known_peers = + env.create_database(&mut rwtxn, Some("known_peers"))?; + const SEED_NODE_ADDR: SocketAddr = SocketAddr::new( + std::net::IpAddr::V4(std::net::Ipv4Addr::new( + 172, 105, 148, 135, + )), + 3820, + ); + known_peers.put(&mut rwtxn, &SEED_NODE_ADDR, &())?; + known_peers + } + }; rwtxn.commit()?; let (peer_info_tx, peer_info_rx) = mpsc::unbounded(); let net = Net {