From 718d04683353a422013105aea9405cab7d973f1e Mon Sep 17 00:00:00 2001 From: Jonathan Moody <103143855+moodyjon@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:10:57 -0500 Subject: [PATCH] Logging for test_single_server_payment debug. --- lbry/wallet/usage_payment.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lbry/wallet/usage_payment.py b/lbry/wallet/usage_payment.py index c930a996c..f6232d038 100644 --- a/lbry/wallet/usage_payment.py +++ b/lbry/wallet/usage_payment.py @@ -28,29 +28,37 @@ class WalletServerPayer: async def pay(self): while self.running: + log.info("pay loop: before sleep") await asyncio.sleep(self.payment_period) + log.info("pay loop: before get_server_features") features = await self.ledger.network.retriable_call(self.ledger.network.get_server_features) + log.info("pay loop: received features: %s", str(features)) address = features['payment_address'] amount = str(features['daily_fee']) if not address or not amount: + log.warning("pay loop: no address or no amount") continue if not self.ledger.is_pubkey_address(address): + log.warning("pay loop: address not pubkey") self._on_payment_controller.add_error(ServerPaymentInvalidAddressError(address)) continue if self.wallet.is_locked: + log.warning("pay loop: wallet is locked") self._on_payment_controller.add_error(ServerPaymentWalletLockedError()) continue amount = lbc_to_dewies(features['daily_fee']) # check that this is in lbc and not dewies limit = lbc_to_dewies(self.max_fee) if amount > limit: + log.warning("pay loop: amount (%d) > limit (%d)", amount, limit) self._on_payment_controller.add_error( ServerPaymentFeeAboveMaxAllowedError(features['daily_fee'], self.max_fee) ) continue + log.info("pay loop: before transaction create") tx = await Transaction.create( [], [Output.pay_pubkey_hash(amount, self.ledger.address_to_hash160(address))], @@ -58,9 +66,11 @@ class WalletServerPayer: self.wallet.get_account_or_default(None) ) + log.info("pay loop: before transaction broadcast") await self.ledger.broadcast(tx) if self.analytics_manager: await self.analytics_manager.send_credits_sent() + log.info("pay loop: after transaction broadcast") self._on_payment_controller.add(tx) async def start(self, ledger=None, wallet=None):