Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1514 from ethcore/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
NikVolf authored Jul 1, 2016
2 parents b534429 + 52f4034 commit c71dff0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl Client {
imported
}

fn commit_block<B>(&self, block: B, hash: &H256, block_data: &Bytes) -> ImportRoute where B: IsBlock + Drain {
fn commit_block<B>(&self, block: B, hash: &H256, block_data: &[u8]) -> ImportRoute where B: IsBlock + Drain {
let number = block.header().number();
// Are we committing an era?
let ancient = if number >= HISTORY {
Expand Down
18 changes: 10 additions & 8 deletions ethcore/src/miner/work_notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,21 @@ impl WorkPoster {
}

fn create_client() -> Client<PostHandler> {
let client = Client::<PostHandler>::configure()
Client::<PostHandler>::configure()
.keep_alive(true)
.build().expect("Error creating HTTP client") as Client<PostHandler>;
client
.build()
.expect("Error creating HTTP client")
}

pub fn notify(&self, pow_hash: H256, difficulty: U256, number: u64) {
// TODO: move this to engine
let target = Ethash::difficulty_to_boundary(&difficulty);
let seed_hash = &self.seed_compute.lock().unwrap().get_seedhash(number);
let seed_hash = H256::from_slice(&seed_hash[..]);
let body = format!(r#"{{ "result": ["0x{}","0x{}","0x{}","0x{:x}"] }}"#,
pow_hash.hex(), seed_hash.hex(), target.hex(), number);
let body = format!(
r#"{{ "result": ["0x{}","0x{}","0x{}","0x{:x}"] }}"#,
pow_hash.hex(), seed_hash.hex(), target.hex(), number
);
let mut client = self.client.lock().unwrap();
for u in &self.urls {
if let Err(e) = client.request(u.clone(), PostHandler { body: body.clone() }) {
Expand Down Expand Up @@ -104,12 +106,12 @@ impl hyper::client::Handler<HttpStream> for PostHandler {
}

fn on_response_readable(&mut self, _decoder: &mut hyper::Decoder<HttpStream>) -> Next {
Next::end()
Next::end()
}

fn on_error(&mut self, err: hyper::Error) -> Next {
fn on_error(&mut self, err: hyper::Error) -> Next {
trace!("Error posting work data: {}", err);
Next::end()
}
}
}

2 changes: 1 addition & 1 deletion util/bigint/src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use std::cmp;

use std::str::{FromStr};
use std::convert::From;
use std::hash::{Hash, Hasher};
use std::hash::Hash;
use std::ops::*;
use std::cmp::*;

Expand Down
2 changes: 1 addition & 1 deletion util/src/network/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
self.info.write().unwrap().public_endpoint = Some(public_endpoint.clone());

if self.first_time.load(AtomicOrdering::Relaxed) {
info!("Public node URL: {}", paint(White.bold(), format!("{}", self.external_url().unwrap())));
info!("Public node URL: {}", paint(White.bold(), self.external_url().unwrap()));
self.first_time.store(false, AtomicOrdering::Relaxed);
}

Expand Down

0 comments on commit c71dff0

Please sign in to comment.