Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ arraydeque = "0.5.1"
arrayref = "0.3.6"
base64 = "0.22"
bincode = "1.3.1"
bitcoin = { version = "0.32.4", features = ["serde", "rand"] }
bitcoin = { version = "0.32.4", features = ["serde"] }
clap = "2.33.3"
crossbeam-channel = "0.5.0"
dirs = "5.0.1"
Expand Down Expand Up @@ -70,6 +70,7 @@ opentelemetry-otlp = { version = "0.13.0", default-features = false, features =
tracing-subscriber = { version = "0.3.17", default-features = false, features = ["env-filter", "fmt"], optional = true }
opentelemetry-semantic-conventions = { version = "0.12.0", optional = true }
tracing = { version = "0.1.40", default-features = false, features = ["attributes"], optional = true }
rand = "0.9.1"

# optional dependencies for electrum-discovery
electrum-client = { version = "0.8", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions src/bin/electrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{env, process, thread};
use std::sync::{Arc, RwLock};
use std::time::Duration;
use bitcoin::hex::DisplayHex;
use bitcoin::secp256k1::rand;
use rand::{rng, RngCore};
use electrs::{
config::Config,
daemon::Daemon,
Expand Down Expand Up @@ -161,7 +161,8 @@ fn run_server(config: Arc<Config>, salt_rwlock: Arc<RwLock<String>>) -> Result<(
}

fn generate_salt() -> String {
let random_bytes: [u8; 32] = rand::random();
let mut random_bytes = [0u8; 32];
rng().fill_bytes(&mut random_bytes);
random_bytes.to_lower_hex_string()
}

Expand Down