diff --git a/CHANGELOG.md b/CHANGELOG.md index 60b016130..ebffb776f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,9 @@ at anytime. * ### Fixed - * - * + * Fixed slow startup for nodes with many lbry files + * Fixed setting the external ip on startup + * Fixed session startup not blocking on joining the dht ### Deprecated * diff --git a/lbrynet/core/Session.py b/lbrynet/core/Session.py index f390c6d26..41742305c 100644 --- a/lbrynet/core/Session.py +++ b/lbrynet/core/Session.py @@ -260,8 +260,7 @@ class Session(object): addresses.append(value) return addresses - def start_dht(addresses): - self.dht_node.joinNetwork(addresses) + def start_dht(join_network_result): self.peer_finder.run_manage_loop() self.hash_announcer.run_manage_loop() return True @@ -283,6 +282,7 @@ class Session(object): dl = defer.DeferredList(ds) dl.addCallback(join_resolved_addresses) + dl.addCallback(self.dht_node.joinNetwork) dl.addCallback(start_dht) return dl diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 9860306fa..aa4590c75 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -569,7 +569,8 @@ class Daemon(AuthJSONRPCServer): peer_port=self.peer_port, use_upnp=self.use_upnp, wallet=wallet, - is_generous=conf.settings['is_generous_host'] + is_generous=conf.settings['is_generous_host'], + external_ip=self.platform['ip'] ) self.startup_status = STARTUP_STAGES[2] diff --git a/lbrynet/file_manager/EncryptedFileManager.py b/lbrynet/file_manager/EncryptedFileManager.py index b0f9966a1..fd96aa8f0 100644 --- a/lbrynet/file_manager/EncryptedFileManager.py +++ b/lbrynet/file_manager/EncryptedFileManager.py @@ -53,9 +53,9 @@ class EncryptedFileManager(object): def setup(self): yield self._open_db() yield self._add_to_sd_identifier() - yield self._start_lbry_files() - if self.auto_re_reflect is True: - safe_start_looping_call(self.lbry_file_reflector, self.auto_re_reflect_interval) + # don't block on starting the lbry files + self._start_lbry_files() + log.info("Started file manager") def get_lbry_file_status(self, lbry_file): return self._get_lbry_file_status(lbry_file.rowid) @@ -119,6 +119,9 @@ class EncryptedFileManager(object): self._set_options_and_restore(rowid, stream_hash, options) for rowid, stream_hash, options in files_and_options ]) + + if self.auto_re_reflect is True: + safe_start_looping_call(self.lbry_file_reflector, self.auto_re_reflect_interval) log.info("Started %i lbry files", len(self.lbry_files)) @defer.inlineCallbacks