From 7e93ea8d9771d0ebd435a89750c20f2b261c4b88 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Mon, 4 Dec 2017 17:16:59 -0500 Subject: [PATCH] do a sanity check to see if we have remote height, use remote height instead of local height when auto renewing --- lbrynet/daemon/Daemon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index ebd6fb94a..060fe9777 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -299,8 +299,11 @@ class Daemon(AuthJSONRPCServer): # auto renew is turned off if 0 or some negative number if self.auto_renew_claim_height_delta < 1: 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") - 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) for outpoint, result in results.iteritems(): if result['success']: