More explicit panic when syn can't get a peer

This commit is contained in:
Ignotus Peverell 2017-11-22 15:54:50 -05:00
parent 31f8f2ad3e
commit 861c54c13b
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -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);