add total_diff to ping/pong msgs (#350)

* add total_diff to ping/pong msgs
debug log for total_diff on each ping/pong

* expose peer addr to the handle_payload fn
so we know where it came from

* fix p2p tests for ping

* default to 0 if we cannot read total_difficulty

* updating a connected peer in place

* actually update peer info diff

* fixup p2p tests
This commit is contained in:
AntiochP
2017-11-21 09:24:29 -05:00
committed by GitHub
parent ce82c82b0d
commit 6352dfbac9
11 changed files with 178 additions and 59 deletions
+1
View File
@@ -247,6 +247,7 @@ impl Handler for PeersConnectedHandler {
fn handle(&self, _req: &mut Request) -> IronResult<Response> {
let mut peers = vec![];
for p in &self.p2p_server.all_peers() {
let p = p.read().unwrap();
let peer_info = p.info.clone();
peers.push(peer_info);
}