logging levels
lnpeer: received orphan channel update -> debug exchange_rate: received quotes -> debug
This commit is contained in:
@@ -93,7 +93,7 @@ class ExchangeBase(Logger):
|
|||||||
self.logger.exception(f"failed fx quotes: {repr(e)}")
|
self.logger.exception(f"failed fx quotes: {repr(e)}")
|
||||||
self.on_quotes()
|
self.on_quotes()
|
||||||
else:
|
else:
|
||||||
self.logger.info("received fx quotes")
|
self.logger.debug("received fx quotes")
|
||||||
self._quotes_timestamp = time.time()
|
self._quotes_timestamp = time.time()
|
||||||
self.on_quotes(received_new_data=True)
|
self.on_quotes(received_new_data=True)
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ class ExchangeBase(Logger):
|
|||||||
try:
|
try:
|
||||||
self.logger.info(f"requesting fx history for {ccy}")
|
self.logger.info(f"requesting fx history for {ccy}")
|
||||||
h_new = await self.request_history(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:
|
except (aiohttp.ClientError, asyncio.TimeoutError, OSError) as e:
|
||||||
self.logger.info(f"failed fx history: {repr(e)}")
|
self.logger.info(f"failed fx history: {repr(e)}")
|
||||||
return
|
return
|
||||||
@@ -208,6 +208,7 @@ class ExchangeBase(Logger):
|
|||||||
return Decimal('NaN')
|
return Decimal('NaN')
|
||||||
return Decimal(rate)
|
return Decimal(rate)
|
||||||
|
|
||||||
|
|
||||||
class Yadio(ExchangeBase):
|
class Yadio(ExchangeBase):
|
||||||
|
|
||||||
async def get_currencies(self):
|
async def get_currencies(self):
|
||||||
@@ -218,6 +219,7 @@ class Yadio(ExchangeBase):
|
|||||||
json = await self.get_json('api.yadio.io', '/rate/%s/BTC' % ccy)
|
json = await self.get_json('api.yadio.io', '/rate/%s/BTC' % ccy)
|
||||||
return {ccy: to_decimal(json['rate'])}
|
return {ccy: to_decimal(json['rate'])}
|
||||||
|
|
||||||
|
|
||||||
class BitcoinAverage(ExchangeBase):
|
class BitcoinAverage(ExchangeBase):
|
||||||
# note: historical rates used to be freely available
|
# note: historical rates used to be freely available
|
||||||
# but this is no longer the case. see #5188
|
# but this is no longer the case. see #5188
|
||||||
@@ -247,9 +249,8 @@ class BitcoinVenezuela(ExchangeBase):
|
|||||||
return ['ARS', 'EUR', 'USD', 'VEF']
|
return ['ARS', 'EUR', 'USD', 'VEF']
|
||||||
|
|
||||||
async def request_history(self, ccy):
|
async def request_history(self, ccy):
|
||||||
json = await self.get_json('api.bitcoinvenezuela.com',
|
json = await self.get_json('api.bitcoinvenezuela.com', "/historical/index.php?coin=BTC")
|
||||||
"/historical/index.php?coin=BTC")
|
return json[ccy + '_BTC']
|
||||||
return json[ccy +'_BTC']
|
|
||||||
|
|
||||||
|
|
||||||
class Bitbank(ExchangeBase):
|
class Bitbank(ExchangeBase):
|
||||||
|
|||||||
@@ -461,7 +461,7 @@ class Peer(Logger, EventListener):
|
|||||||
# as it might be for our own direct channel with this peer
|
# as it might be for our own direct channel with this peer
|
||||||
# (and we might not yet know the short channel id for that)
|
# (and we might not yet know the short channel id for that)
|
||||||
# Background: this code is here to deal with a bug in LND,
|
# 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
|
# and https://github.com/lightningnetwork/lightning-rfc/pull/657
|
||||||
# This code assumes gossip_queries is set. BOLT7: "if the
|
# This code assumes gossip_queries is set. BOLT7: "if the
|
||||||
# gossip_queries feature is negotiated, [a node] MUST NOT
|
# gossip_queries feature is negotiated, [a node] MUST NOT
|
||||||
@@ -469,7 +469,7 @@ class Peer(Logger, EventListener):
|
|||||||
# NOTE: The definition of gossip_queries changed
|
# NOTE: The definition of gossip_queries changed
|
||||||
# https://github.com/lightning/bolts/commit/fce8bab931674a81a9ea895c9e9162e559e48a65
|
# https://github.com/lightning/bolts/commit/fce8bab931674a81a9ea895c9e9162e559e48a65
|
||||||
short_channel_id = ShortChannelID(payload['short_channel_id'])
|
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
|
self.orphan_channel_updates[short_channel_id] = payload
|
||||||
while len(self.orphan_channel_updates) > 25:
|
while len(self.orphan_channel_updates) > 25:
|
||||||
self.orphan_channel_updates.popitem(last=False)
|
self.orphan_channel_updates.popitem(last=False)
|
||||||
@@ -2643,7 +2643,7 @@ class Peer(Logger, EventListener):
|
|||||||
feerate_per_kw += 1
|
feerate_per_kw += 1
|
||||||
else:
|
else:
|
||||||
return
|
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}")
|
f"new feerate {feerate_per_kw}")
|
||||||
chan.update_fee(feerate_per_kw, True)
|
chan.update_fee(feerate_per_kw, True)
|
||||||
self.send_message(
|
self.send_message(
|
||||||
@@ -2663,7 +2663,7 @@ class Peer(Logger, EventListener):
|
|||||||
self.logger.info(f'({chan.get_id_for_log()}) Channel closed {txid}')
|
self.logger.info(f'({chan.get_id_for_log()}) Channel closed {txid}')
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
txid = chan.unconfirmed_closing_txid
|
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:
|
if txid is None:
|
||||||
raise Exception('The remote peer did not send their final signature. The channel may not have been be closed')
|
raise Exception('The remote peer did not send their final signature. The channel may not have been be closed')
|
||||||
return txid
|
return txid
|
||||||
|
|||||||
Reference in New Issue
Block a user