diff --git a/lbrynet/core/BlobManager.py b/lbrynet/core/BlobManager.py index ed9285ba2..4d9f390fd 100644 --- a/lbrynet/core/BlobManager.py +++ b/lbrynet/core/BlobManager.py @@ -120,6 +120,7 @@ class DiskBlobManager(BlobManager): return self.blob_creator_type(self, self.blob_dir) def _make_new_blob(self, blob_hash, upload_allowed, length=None): + log.debug('Making a new blob for %s', blob_hash) blob = self.blob_type(self.blob_dir, blob_hash, upload_allowed, length) self.blobs[blob_hash] = blob d = self._completed_blobs([blob_hash]) @@ -143,9 +144,11 @@ class DiskBlobManager(BlobManager): def blob_completed(self, blob, next_announce_time=None): if next_announce_time is None: - next_announce_time = time.time() - return self._add_completed_blob(blob.blob_hash, blob.length, - time.time(), next_announce_time) + next_announce_time = time.time() + self.hash_reannounce_time + d = self._add_completed_blob(blob.blob_hash, blob.length, + time.time(), next_announce_time) + d.addCallback(lambda _: self.hash_announcer.immediate_announce([blob.blob_hash])) + return d def completed_blobs(self, blobs_to_check): return self._completed_blobs(blobs_to_check) diff --git a/lbrynet/core/server/DHTHashAnnouncer.py b/lbrynet/core/server/DHTHashAnnouncer.py index eca877f73..8ce55ffd9 100644 --- a/lbrynet/core/server/DHTHashAnnouncer.py +++ b/lbrynet/core/server/DHTHashAnnouncer.py @@ -42,6 +42,7 @@ class DHTHashAnnouncer(object): return defer.succeed(False) def _announce_available_hashes(self): + log.debug('Announcing available hashes') ds = [] for supplier in self.suppliers: d = supplier.hashes_to_announce() @@ -62,6 +63,7 @@ class DHTHashAnnouncer(object): def announce(): if len(self.hash_queue): h, announce_deferred = self.hash_queue.popleft() + log.debug('Announcing blob %s to dht', h) d = self.dht_node.announceHaveBlob(binascii.unhexlify(h), self.peer_port) d.chainDeferred(announce_deferred) d.addBoth(lambda _: reactor.callLater(0, announce))