From 861c54c13b7603470f8313a5243f0615095aac2b Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Wed, 22 Nov 2017 15:54:50 -0500 Subject: [PATCH] More explicit panic when syn can't get a peer --- grin/src/sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grin/src/sync.rs b/grin/src/sync.rs index b1123eaa4..b906a800f 100644 --- a/grin/src/sync.rs +++ b/grin/src/sync.rs @@ -316,7 +316,7 @@ impl Syncer { /// Pick a random peer and ask for a block by hash fn request_block(&self, h: Hash) { - let peer = self.p2p.random_peer().unwrap(); + let peer = self.p2p.random_peer().expect("No connected peer."); let peer = peer.read().unwrap(); if let Err(e) = peer.send_block_request(h) { debug!(LOGGER, "Sync: Error requesting block: {:?}", e);