edition = "2018"
[dependencies]
-base64 = "0.13.0"
-bech32 = "0.8"
bitcoin = "0.28.1"
-bitcoin-bech32 = "0.12"
lightning = { version = "0.0.110" }
lightning-block-sync = { version = "0.0.110", features=["rest-client"] }
lightning-net-tokio = { version = "0.0.110" }
-chrono = "0.4"
-hex = "0.3"
-rand = "0.4"
tokio = { version = "1.14.1", features = ["full"] }
tokio-postgres = { version="0.7.5" }
+use std::collections::hash_map::RandomState;
+use std::hash::{BuildHasher, Hasher};
use std::net::SocketAddr;
use std::sync::Arc;
use std::time::{Duration, Instant};
ErroringMessageHandler, IgnoringMessageHandler, MessageHandler, PeerManager,
};
use lightning::routing::gossip::NetworkGraph;
-use rand::{Rng, thread_rng};
use tokio::sync::mpsc;
use crate::{config, TestLogger};
pub(crate) async fn download_gossip(persistence_sender: mpsc::Sender<GossipMessage>,
completion_sender: mpsc::Sender<()>,
network_graph: Arc<NetworkGraph<TestLogger>>) {
- let mut key = [0; 32];
- let mut random_data = [0; 32];
- thread_rng().fill_bytes(&mut key);
- thread_rng().fill_bytes(&mut random_data);
- let our_node_secret = SecretKey::from_slice(&key).unwrap();
+ let mut key = [42; 32];
+ let mut random_data = [43; 32];
+ // Get something psuedo-random from std.
+ let mut key_hasher = RandomState::new().build_hasher();
+ key_hasher.write_u8(1);
+ key[0..8].copy_from_slice(&key_hasher.finish().to_ne_bytes());
+ let mut rand_hasher = RandomState::new().build_hasher();
+ rand_hasher.write_u8(2);
+ random_data[0..8].copy_from_slice(&rand_hasher.finish().to_ne_bytes());
+ let our_node_secret = SecretKey::from_slice(&key).unwrap();
let router = Arc::new(GossipRouter::new(network_graph, persistence_sender.clone()));
let message_handler = MessageHandler {