Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fixed race condition deadlock on fetching enode URL #4354

Merged
merged 1 commit into from
Jan 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions util/network/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,13 @@ impl Host {
}

pub fn external_url(&self) -> Option<String> {
self.info.read().public_endpoint.as_ref().map(|e| format!("{}", Node::new(self.info.read().id().clone(), e.clone())))
let info = self.info.read();
info.public_endpoint.as_ref().map(|e| format!("{}", Node::new(info.id().clone(), e.clone())))
}

pub fn local_url(&self) -> String {
let r = format!("{}", Node::new(self.info.read().id().clone(), self.info.read().local_endpoint.clone()));
println!("{}", r);
r
let info = self.info.read();
format!("{}", Node::new(info.id().clone(), info.local_endpoint.clone()))
}

pub fn stop(&self, io: &IoContext<NetworkIoMessage>) -> Result<(), NetworkError> {
Expand Down