fix request_needed_blobs for partially reflected streams

This commit is contained in:
Jack Robison 2018-06-15 10:06:06 -04:00
parent 42daf0fc3f
commit 4c97d2af2e
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 4 additions and 3 deletions

View file

@ -15,6 +15,7 @@ at anytime.
### Fixed ### Fixed
* fixed token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248) * fixed token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248)
* fixed a race condition when inserting a blob into the database (https://github.com/lbryio/lbry/issues/1129) * fixed a race condition when inserting a blob into the database (https://github.com/lbryio/lbry/issues/1129)
* reflector server incorrectly responding as if it has all the blobs for a stream that was only partially uploaded to it
### Deprecated ### Deprecated
* *

View file

@ -252,7 +252,7 @@ class ReflectorServer(Protocol):
sd_info = yield BlobStreamDescriptorReader(sd_blob).get_info() sd_info = yield BlobStreamDescriptorReader(sd_blob).get_info()
yield save_sd_info(self.blob_manager, sd_blob.blob_hash, sd_info) yield save_sd_info(self.blob_manager, sd_blob.blob_hash, sd_info)
yield self.storage.verify_will_announce_head_and_sd_blobs(sd_info['stream_hash']) yield self.storage.verify_will_announce_head_and_sd_blobs(sd_info['stream_hash'])
response = yield self.request_needed_blobs({SEND_SD_BLOB: False}, sd_blob) response = yield self.request_needed_blobs({SEND_SD_BLOB: False}, sd_info['stream_hash'])
else: else:
self.incoming_blob = sd_blob self.incoming_blob = sd_blob
self.receiving_blob = True self.receiving_blob = True
@ -261,8 +261,8 @@ class ReflectorServer(Protocol):
defer.returnValue(response) defer.returnValue(response)
@defer.inlineCallbacks @defer.inlineCallbacks
def request_needed_blobs(self, response, sd_blob): def request_needed_blobs(self, response, stream_hash):
needed_blobs = yield self.storage.get_pending_blobs_for_stream(sd_blob.blob_hash) needed_blobs = yield self.storage.get_pending_blobs_for_stream(stream_hash)
response.update({NEEDED_BLOBS: needed_blobs}) response.update({NEEDED_BLOBS: needed_blobs})
defer.returnValue(response) defer.returnValue(response)