Skip to content

Commit

Permalink
Add seed node as default peer, bump version number for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-L2L committed May 27, 2024
1 parent 417ac54 commit 6432418
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
[workspace.package]
authors = [ "Ash Manning <[email protected]>" ]
edition = "2021"
version = "0.8.6"
version = "0.8.7"

[workspace.dependencies.bip300301]
git = "https://github.com/Ash-L2L/bip300301.git"
Expand Down
16 changes: 15 additions & 1 deletion lib/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6432418

Please sign in to comment.