Skip to content

Commit 5e7250a

Browse files
authored
Merge pull request #1013 from benthecarman/osrng
Make mnemonic RNG selection explicit
2 parents 931df07 + 97aa47d commit 5e7250a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/entropy.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
use std::fmt;
1111

12-
use bip39::Mnemonic;
12+
use bip39::{rand::rngs::OsRng, Language, Mnemonic};
1313

1414
use crate::config::WALLET_KEYS_SEED_LEN;
1515
use crate::io;
@@ -128,7 +128,8 @@ impl fmt::Debug for NodeEntropy {
128128
/// [`Node`]: crate::Node
129129
pub fn generate_entropy_mnemonic(word_count: Option<WordCount>) -> Mnemonic {
130130
let word_count = word_count.unwrap_or(WordCount::Words24).word_count();
131-
Mnemonic::generate(word_count).expect("Failed to generate mnemonic")
131+
Mnemonic::generate_in_with(&mut OsRng, Language::English, word_count)
132+
.expect("Failed to generate mnemonic")
132133
}
133134

134135
/// Supported BIP39 mnemonic word counts for entropy generation.

0 commit comments

Comments
 (0)