Debug log for block broadcast

This commit is contained in:
Ignotus Peverell
2017-11-19 16:05:03 -05:00
parent fed0bd3ed3
commit c1be4e2113
+4
View File
@@ -265,13 +265,17 @@ impl Server {
/// the block.
pub fn broadcast_block(&self, b: &core::Block) {
let peers = self.all_peers();
let mut count = 0;
for p in peers.deref() {
if p.is_connected() {
if let Err(e) = p.send_block(b) {
debug!(LOGGER, "Error sending block to peer: {:?}", e);
} else {
count += 1;
}
}
}
debug!(LOGGER, "Bardcasted block {} to {} peers.", b.header.height, count);
}
/// Broadcasts the provided transaction to all our peers. A peer