diff --git a/Cargo.lock b/Cargo.lock index 9af1284..27c0ff3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3768,7 +3768,7 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain_bitassets" -version = "0.8.6" +version = "0.8.7" dependencies = [ "addr", "anyhow", @@ -3816,7 +3816,7 @@ dependencies = [ [[package]] name = "plain_bitassets_app" -version = "0.8.6" +version = "0.8.7" dependencies = [ "anyhow", "async_zmq", @@ -3856,7 +3856,7 @@ dependencies = [ [[package]] name = "plain_bitassets_app_cli" -version = "0.8.6" +version = "0.8.7" dependencies = [ "anyhow", "bip300301", @@ -3870,7 +3870,7 @@ dependencies = [ [[package]] name = "plain_bitassets_app_rpc_api" -version = "0.8.6" +version = "0.8.7" dependencies = [ "bip300301", "fraction", diff --git a/Cargo.toml b/Cargo.toml index 03abf70..cb462ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ [workspace.package] authors = [ "Ash Manning " ] edition = "2021" -version = "0.8.6" +version = "0.8.7" [workspace.dependencies.bip300301] git = "https://github.com/Ash-L2L/bip300301.git" diff --git a/lib/net/mod.rs b/lib/net/mod.rs index 2e506e6..5b66a01 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, + )), + 38010, + ); + known_peers.put(&mut rwtxn, &SEED_NODE_ADDR, &())?; + known_peers + } + }; rwtxn.commit()?; let (peer_info_tx, peer_info_rx) = mpsc::unbounded(); let net = Net {