From 62f5f8e3f9098b44e0ba9ec1eccdd007bc67b089 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Wed, 19 Feb 2020 08:46:26 +0100 Subject: [PATCH] Removed explicit dependency on rand. --- examples/handshake.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/handshake.rs b/examples/handshake.rs index a8a1678a..2536800d 100644 --- a/examples/handshake.rs +++ b/examples/handshake.rs @@ -1,4 +1,6 @@ -use rand::Rng; +extern crate bitcoin; + +use bitcoin::secp256k1::rand::Rng; use std::io::Write; use std::net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr, TcpStream}; use std::time::{SystemTime, UNIX_EPOCH}; @@ -81,7 +83,7 @@ fn build_version_message(address: SocketAddr) -> message::NetworkMessage { let addr_from = address::Address::new(&my_address, constants::ServiceFlags::NONE); // "Node random nonce, randomly generated every time a version packet is sent. This nonce is used to detect connections to self." - let nonce: u64 = rand::thread_rng().gen(); + let nonce: u64 = secp256k1::rand::thread_rng().gen(); // "User Agent (0x00 if string is 0 bytes long)" let user_agent = String::from("rust-example");