From 1d906fb0c7fd82cd36eeff5496ca6c783d0f832d Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Thu, 12 Jul 2018 14:15:16 -0400 Subject: [PATCH] create_and_publish_stream fix --- lbrynet/daemon/Publisher.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lbrynet/daemon/Publisher.py b/lbrynet/daemon/Publisher.py index 34d822bc8..34a5402ea 100644 --- a/lbrynet/daemon/Publisher.py +++ b/lbrynet/daemon/Publisher.py @@ -6,6 +6,7 @@ from twisted.internet import defer from lbrynet.core import file_utils from lbrynet.file_manager.EncryptedFileCreator import create_lbry_file +from lbrynet.wallet.account import get_certificate_lookup log = logging.getLogger(__name__) @@ -43,11 +44,11 @@ class Publisher(object): claim_dict['stream']['source']['sourceType'] = 'lbry_sd_hash' claim_dict['stream']['source']['contentType'] = get_content_type(file_path) claim_dict['stream']['source']['version'] = "_0_0_1" # need current version here - claim_out = yield self.make_claim(name, bid, claim_dict, claim_address, change_address) + tx = yield self.make_claim(name, bid, claim_dict, claim_address, change_address) # check if we have a file already for this claim (if this is a publish update with a new stream) old_stream_hashes = yield self.storage.get_old_stream_hashes_for_claim_id( - claim_out['claim_id'], self.lbry_file.stream_hash + tx.get_claim_id(0), self.lbry_file.stream_hash ) if old_stream_hashes: for lbry_file in filter(lambda l: l.stream_hash in old_stream_hashes, @@ -56,9 +57,9 @@ class Publisher(object): log.info("Removed old stream for claim update: %s", lbry_file.stream_hash) yield self.storage.save_content_claim( - self.lbry_file.stream_hash, "%s:%i" % (claim_out['txid'], claim_out['nout']) + self.lbry_file.stream_hash, get_certificate_lookup(tx, 0) ) - defer.returnValue(claim_out) + defer.returnValue(tx) @defer.inlineCallbacks def publish_stream(self, name, bid, claim_dict, stream_hash, claim_address=None, change_address=None):