Merge pull request #602 from lbryio/fix-file-with-abandoned-claim

fix file_list for files with abandoned claims
This commit is contained in:
Jack Robison 2017-04-09 21:51:02 -04:00 committed by GitHub
commit 0ff308e3eb
3 changed files with 10 additions and 11 deletions

View file

@ -21,7 +21,7 @@ at anytime.
### Fixed ### Fixed
* `file_list` for files with bad signatures * `file_list` for files with bad signatures
* return None from resolve commands when nothing is found * return None from resolve commands when nothing is found
* * return lbry files with claims that are abandoned
## [0.9.2rc9] - 2017-04-08 ## [0.9.2rc9] - 2017-04-08
### Added ### Added

View file

@ -454,6 +454,9 @@ class Wallet(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def get_claim(self, claim_id): def get_claim(self, claim_id):
claim = yield self._get_claim_by_claimid(claim_id) claim = yield self._get_claim_by_claimid(claim_id)
if not claim:
log.warning("Claim does not exist: %s", claim_id)
defer.returnValue(None)
try: try:
decoded = smart_decode(claim['value']) decoded = smart_decode(claim['value'])
claim['value'] = decoded.claim_dict claim['value'] = decoded.claim_dict

View file

@ -909,19 +909,15 @@ class Daemon(AuthJSONRPCServer):
size = None size = None
message = None message = None
if lbry_file.claim_id:
claim = yield self.session.wallet.get_claim(lbry_file.claim_id) claim = yield self.session.wallet.get_claim(lbry_file.claim_id)
else:
claim = yield self.session.wallet.get_claim_info(lbry_file.name, if claim and 'value' in claim:
lbry_file.txid,
lbry_file.nout)
try:
metadata = claim['value'] metadata = claim['value']
except: else:
metadata = None metadata = None
try: if lbry_file.txid and lbry_file.nout is not None:
outpoint = repr(ClaimOutpoint(lbry_file.txid, lbry_file.nout)) outpoint = repr(ClaimOutpoint(lbry_file.txid, lbry_file.nout))
except TypeError: else:
outpoint = None outpoint = None
if claim and 'has_signature' in claim: if claim and 'has_signature' in claim: