diff --git a/src/hash.rs b/src/hash.rs index f67833072..e3c05a79a 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -444,6 +444,16 @@ impl From for Address { } } } + +impl From for H64 { + fn from(value: H256) -> H64 { + unsafe { + let mut ret: H64 = ::std::mem::uninitialized(); + ::std::ptr::copy(value.as_ptr().offset(20), ret.as_mut_ptr(), 8); + ret + } + } +} /* impl<'_> From<&'_ H256> for Address { fn from(value: &'_ H256) -> Address { diff --git a/src/network/host.rs b/src/network/host.rs index 7a43b6959..b562ca765 100644 --- a/src/network/host.rs +++ b/src/network/host.rs @@ -355,7 +355,6 @@ impl Host where Message: Send { let nonce = self.info.next_nonce(); match self.connections.insert_with(|token| ConnectionEntry::Handshake(Handshake::new(token, id, socket, &nonce).expect("Can't create handshake"))) { Some(token) => { - warn!(target: "slab", "inserted {}", token.as_usize()); match self.connections.get_mut(token) { Some(&mut ConnectionEntry::Handshake(ref mut h)) => { h.start(&self.info, true) @@ -536,7 +535,6 @@ impl Host where Message: Send { h.disconnected(&mut NetworkContext::new(io, p, Some(token), &mut self.connections, &mut self.timers), &token); } self.connections.remove(Token(token)); - warn!(target: "slab", "removed {}", token); } }