1
0

logging levels

lnpeer: received orphan channel update -> debug
exchange_rate: received quotes -> debug
This commit is contained in:
Sander van Grieken
2025-04-24 09:03:50 +02:00
parent 64a160027a
commit 0ccdddf46a
2 changed files with 10 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ class ExchangeBase(Logger):
self.logger.exception(f"failed fx quotes: {repr(e)}")
self.on_quotes()
else:
self.logger.info("received fx quotes")
self.logger.debug("received fx quotes")
self._quotes_timestamp = time.time()
self.on_quotes(received_new_data=True)
@@ -142,7 +142,7 @@ class ExchangeBase(Logger):
try:
self.logger.info(f"requesting fx history for {ccy}")
h_new = await self.request_history(ccy)
self.logger.info(f"received fx history for {ccy}")
self.logger.debug(f"received fx history for {ccy}")
except (aiohttp.ClientError, asyncio.TimeoutError, OSError) as e:
self.logger.info(f"failed fx history: {repr(e)}")
return
@@ -208,6 +208,7 @@ class ExchangeBase(Logger):
return Decimal('NaN')
return Decimal(rate)
class Yadio(ExchangeBase):
async def get_currencies(self):
@@ -218,6 +219,7 @@ class Yadio(ExchangeBase):
json = await self.get_json('api.yadio.io', '/rate/%s/BTC' % ccy)
return {ccy: to_decimal(json['rate'])}
class BitcoinAverage(ExchangeBase):
# note: historical rates used to be freely available
# but this is no longer the case. see #5188
@@ -247,9 +249,8 @@ class BitcoinVenezuela(ExchangeBase):
return ['ARS', 'EUR', 'USD', 'VEF']
async def request_history(self, ccy):
json = await self.get_json('api.bitcoinvenezuela.com',
"/historical/index.php?coin=BTC")
return json[ccy +'_BTC']
json = await self.get_json('api.bitcoinvenezuela.com', "/historical/index.php?coin=BTC")
return json[ccy + '_BTC']
class Bitbank(ExchangeBase):

View File

@@ -461,7 +461,7 @@ class Peer(Logger, EventListener):
# as it might be for our own direct channel with this peer
# (and we might not yet know the short channel id for that)
# Background: this code is here to deal with a bug in LND,
# see https://github.com/lightningnetwork/lnd/issues/3651
# see https://github.com/lightningnetwork/lnd/issues/3651 (closed 2022-08-13, lnd-v0.15.1)
# and https://github.com/lightningnetwork/lightning-rfc/pull/657
# This code assumes gossip_queries is set. BOLT7: "if the
# gossip_queries feature is negotiated, [a node] MUST NOT
@@ -469,7 +469,7 @@ class Peer(Logger, EventListener):
# NOTE: The definition of gossip_queries changed
# https://github.com/lightning/bolts/commit/fce8bab931674a81a9ea895c9e9162e559e48a65
short_channel_id = ShortChannelID(payload['short_channel_id'])
self.logger.info(f'received orphan channel update {short_channel_id}')
self.logger.debug(f'received orphan channel update {short_channel_id}')
self.orphan_channel_updates[short_channel_id] = payload
while len(self.orphan_channel_updates) > 25:
self.orphan_channel_updates.popitem(last=False)
@@ -2643,7 +2643,7 @@ class Peer(Logger, EventListener):
feerate_per_kw += 1
else:
return
self.logger.info(f"(chan: {chan.get_id_for_log()}) current pending feerate {chan_fee}. "
self.logger.info(f"({chan.get_id_for_log()}) current pending feerate {chan_fee}. "
f"new feerate {feerate_per_kw}")
chan.update_fee(feerate_per_kw, True)
self.send_message(
@@ -2663,7 +2663,7 @@ class Peer(Logger, EventListener):
self.logger.info(f'({chan.get_id_for_log()}) Channel closed {txid}')
except asyncio.TimeoutError:
txid = chan.unconfirmed_closing_txid
self.logger.info(f'({chan.get_id_for_log()}) did not send closing_signed, {txid}')
self.logger.warning(f'({chan.get_id_for_log()}) did not send closing_signed, {txid}')
if txid is None:
raise Exception('The remote peer did not send their final signature. The channel may not have been be closed')
return txid