forked from LBRYCommunity/lbry-sdk
get file claim info by outpoint
This commit is contained in:
parent
2c91d30655
commit
a12b011b1e
1 changed files with 6 additions and 6 deletions
|
@ -639,7 +639,7 @@ class SQLiteStorage(object):
|
||||||
def get_content_claim(self, stream_hash, include_supports=True):
|
def get_content_claim(self, stream_hash, include_supports=True):
|
||||||
def _get_content_claim(transaction):
|
def _get_content_claim(transaction):
|
||||||
claim_id = transaction.execute(
|
claim_id = transaction.execute(
|
||||||
"select claim.claim_id from content_claim "
|
"select claim.claim_outpoint from content_claim "
|
||||||
"inner join claim on claim.claim_outpoint=content_claim.claim_outpoint and content_claim.stream_hash=? "
|
"inner join claim on claim.claim_outpoint=content_claim.claim_outpoint and content_claim.stream_hash=? "
|
||||||
"order by claim.rowid desc", (stream_hash, )
|
"order by claim.rowid desc", (stream_hash, )
|
||||||
).fetchone()
|
).fetchone()
|
||||||
|
@ -647,14 +647,14 @@ class SQLiteStorage(object):
|
||||||
return None
|
return None
|
||||||
return claim_id[0]
|
return claim_id[0]
|
||||||
|
|
||||||
content_claim_id = yield self.db.runInteraction(_get_content_claim)
|
content_claim_outpoint = yield self.db.runInteraction(_get_content_claim)
|
||||||
result = None
|
result = None
|
||||||
if content_claim_id:
|
if content_claim_outpoint:
|
||||||
result = yield self.get_claim(content_claim_id, include_supports)
|
result = yield self.get_claim(content_claim_outpoint, include_supports)
|
||||||
defer.returnValue(result)
|
defer.returnValue(result)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_claim(self, claim_id, include_supports=True):
|
def get_claim(self, claim_outpoint, include_supports=True):
|
||||||
def _claim_response(outpoint, claim_id, name, amount, height, serialized, channel_id, address, claim_sequence):
|
def _claim_response(outpoint, claim_id, name, amount, height, serialized, channel_id, address, claim_sequence):
|
||||||
r = {
|
r = {
|
||||||
"name": name,
|
"name": name,
|
||||||
|
@ -673,7 +673,7 @@ class SQLiteStorage(object):
|
||||||
|
|
||||||
def _get_claim(transaction):
|
def _get_claim(transaction):
|
||||||
claim_info = transaction.execute(
|
claim_info = transaction.execute(
|
||||||
"select * from claim where claim_id=? order by rowid desc", (claim_id, )
|
"select * from claim where claim_outpoint=?", (claim_outpoint, )
|
||||||
).fetchone()
|
).fetchone()
|
||||||
result = _claim_response(*claim_info)
|
result = _claim_response(*claim_info)
|
||||||
if result['channel_claim_id']:
|
if result['channel_claim_id']:
|
||||||
|
|
Loading…
Reference in a new issue