build: warnings
This commit is contained in:
parent
eebbf40ce5
commit
019e5428df
5 changed files with 15 additions and 31 deletions
|
@ -16,7 +16,7 @@
|
||||||
//! them into a block and returns it.
|
//! them into a block and returns it.
|
||||||
|
|
||||||
use std::panic::panic_any;
|
use std::panic::panic_any;
|
||||||
use chrono::prelude::{DateTime, NaiveDateTime, Utc};
|
use chrono::prelude::{DateTime, Utc};
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
@ -178,7 +178,7 @@ fn build_block(
|
||||||
|
|
||||||
b.header.pow.nonce = thread_rng().gen();
|
b.header.pow.nonce = thread_rng().gen();
|
||||||
b.header.pow.secondary_scaling = difficulty.secondary_scaling;
|
b.header.pow.secondary_scaling = difficulty.secondary_scaling;
|
||||||
b.header.timestamp = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(now_sec, 0), Utc);
|
b.header.timestamp = DateTime::from_timestamp(now_sec, 0).unwrap();
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
"Built new block with {} inputs and {} outputs, block difficulty: {}, cumulative difficulty {}",
|
"Built new block with {} inputs and {} outputs, block difficulty: {}, cumulative difficulty {}",
|
||||||
|
|
|
@ -384,7 +384,7 @@ impl Node {
|
||||||
if force || !Node::is_running() {
|
if force || !Node::is_running() {
|
||||||
// Get saved server config.
|
// Get saved server config.
|
||||||
let config = NodeConfig::node_server_config();
|
let config = NodeConfig::node_server_config();
|
||||||
let mut server_config = config.server.clone();
|
let server_config = config.server.clone();
|
||||||
// Remove peers folder.
|
// Remove peers folder.
|
||||||
let mut peers_dir = PathBuf::from(&server_config.db_root);
|
let mut peers_dir = PathBuf::from(&server_config.db_root);
|
||||||
peers_dir.push("peer");
|
peers_dir.push("peer");
|
||||||
|
|
|
@ -646,7 +646,7 @@ async fn accept_connections(listen_addr: SocketAddr,
|
||||||
stop_state: Arc<StratumStopState>) {
|
stop_state: Arc<StratumStopState>) {
|
||||||
info!("Start tokio stratum server");
|
info!("Start tokio stratum server");
|
||||||
|
|
||||||
let state_check = stop_state.clone();
|
let _state_check = stop_state.clone();
|
||||||
|
|
||||||
// let task = async move {
|
// let task = async move {
|
||||||
//
|
//
|
||||||
|
@ -812,7 +812,7 @@ impl WorkersList {
|
||||||
|
|
||||||
pub fn login(&self, worker_id: usize, login: String, agent: String) -> Result<(), RpcError> {
|
pub fn login(&self, worker_id: usize, login: String, agent: String) -> Result<(), RpcError> {
|
||||||
let mut wl = self.workers_list.write();
|
let mut wl = self.workers_list.write();
|
||||||
let mut worker = wl
|
let worker = wl
|
||||||
.get_mut(&worker_id)
|
.get_mut(&worker_id)
|
||||||
.ok_or_else(RpcError::internal_error)?;
|
.ok_or_else(RpcError::internal_error)?;
|
||||||
worker.login = Some(login);
|
worker.login = Some(login);
|
||||||
|
|
|
@ -31,7 +31,6 @@ use fs_mistrust::Mistrust;
|
||||||
use grin_util::secp::SecretKey;
|
use grin_util::secp::SecretKey;
|
||||||
use hyper::{Body, Uri};
|
use hyper::{Body, Uri};
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use serde_json::json;
|
|
||||||
use sha2::Sha512;
|
use sha2::Sha512;
|
||||||
use tls_api::{TlsConnector as TlsConnectorTrait, TlsConnectorBuilder};
|
use tls_api::{TlsConnector as TlsConnectorTrait, TlsConnectorBuilder};
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
|
@ -298,21 +297,6 @@ impl Tor {
|
||||||
w_services.remove(&service_id);
|
w_services.remove(&service_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// let data = json!({
|
|
||||||
// "id": 1,
|
|
||||||
// "jsonrpc": "2.0",
|
|
||||||
// "method": "check_version",
|
|
||||||
// "params": []
|
|
||||||
// })
|
|
||||||
// .to_string();
|
|
||||||
// Create http tor-powered client to post data.
|
|
||||||
|
|
||||||
// Create request.
|
|
||||||
// let req = hyper::Request::builder()
|
|
||||||
// .method(hyper::Method::POST)
|
|
||||||
// .uri(url.clone())
|
|
||||||
// .body(Body::from(data))
|
|
||||||
// .unwrap();
|
|
||||||
// Send request.
|
// Send request.
|
||||||
let duration = match http
|
let duration = match http
|
||||||
.get(Uri::from_str(url.clone().as_str()).unwrap())
|
.get(Uri::from_str(url.clone().as_str()).unwrap())
|
||||||
|
|
|
@ -89,16 +89,16 @@ impl WalletList {
|
||||||
list.insert(0, wallet);
|
list.insert(0, wallet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove [`Wallet`] with provided identifier.
|
// /// Remove [`Wallet`] with provided identifier.
|
||||||
pub fn remove(&mut self, id: i64) {
|
// pub fn remove(&mut self, id: i64) {
|
||||||
let list = self.mut_list();
|
// let list = self.mut_list();
|
||||||
for (index, wallet) in list.iter().enumerate() {
|
// for (index, wallet) in list.iter().enumerate() {
|
||||||
if wallet.get_config().id == id {
|
// if wallet.get_config().id == id {
|
||||||
list.remove(index);
|
// list.remove(index);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// Select [`Wallet`] with provided identifier.
|
/// Select [`Wallet`] with provided identifier.
|
||||||
pub fn select(&mut self, id: Option<i64>) {
|
pub fn select(&mut self, id: Option<i64>) {
|
||||||
|
|
Loading…
Reference in a new issue