forked from LBRYCommunity/lbry-sdk
do a sanity check to see if we have remote height, use remote height instead of local height when auto renewing
This commit is contained in:
parent
bfbecd9196
commit
7e93ea8d97
1 changed files with 4 additions and 1 deletions
|
@ -299,8 +299,11 @@ class Daemon(AuthJSONRPCServer):
|
||||||
# auto renew is turned off if 0 or some negative number
|
# auto renew is turned off if 0 or some negative number
|
||||||
if self.auto_renew_claim_height_delta < 1:
|
if self.auto_renew_claim_height_delta < 1:
|
||||||
defer.returnValue(None)
|
defer.returnValue(None)
|
||||||
|
if not self.session.wallet.network.get_remote_height():
|
||||||
|
log.warning("Failed to get remote height, aborting auto renew")
|
||||||
|
defer.returnValue(None)
|
||||||
log.debug("Renewing claim")
|
log.debug("Renewing claim")
|
||||||
h = self.session.wallet.network.get_local_height() + self.auto_renew_claim_height_delta
|
h = self.session.wallet.network.get_remote_height() + self.auto_renew_claim_height_delta
|
||||||
results = yield self.session.wallet.claim_renew_all_before_expiration(h)
|
results = yield self.session.wallet.claim_renew_all_before_expiration(h)
|
||||||
for outpoint, result in results.iteritems():
|
for outpoint, result in results.iteritems():
|
||||||
if result['success']:
|
if result['success']:
|
||||||
|
|
Loading…
Reference in a new issue