lnwatcher/txbatcher: more logging
log more clearly if an input is considered dust, this makes the logs more helpful when debugging sweeping of lightning utxos.
This commit is contained in:
@@ -210,10 +210,12 @@ class LNWatcher(Logger, EventListener):
|
||||
try:
|
||||
self.lnworker.wallet.txbatcher.add_sweep_input('lnwatcher', sweep_info)
|
||||
except BelowDustLimit:
|
||||
self.logger.debug(f"maybe_redeem: BelowDustLimit: {sweep_info.name}")
|
||||
# utxo is considered dust at *current* fee estimates.
|
||||
# but maybe the fees atm are very high? We will retry later.
|
||||
pass
|
||||
except NoDynamicFeeEstimates:
|
||||
self.logger.debug(f"maybe_redeem: NoDynamicFeeEstimates: {sweep_info.name}")
|
||||
pass # will retry later
|
||||
if sweep_info.is_anchor():
|
||||
return False
|
||||
|
||||
@@ -272,9 +272,10 @@ class TxBatch(Logger):
|
||||
value = sweep_info.txin.value_sats()
|
||||
witness_size = len(sweep_info.txin.make_witness(71*b'\x00'))
|
||||
tx_size_vbytes = 84 + witness_size//4 # assumes no batching, sweep to p2wpkh
|
||||
self.logger.info(f'{sweep_info.name} size = {tx_size_vbytes}')
|
||||
fee = self.fee_policy.estimate_fee(tx_size_vbytes, network=self.wallet.network)
|
||||
return value - fee <= dust_threshold()
|
||||
is_dust = value - fee <= dust_threshold()
|
||||
self.logger.info(f'{sweep_info.name} size = {tx_size_vbytes}: {is_dust=}')
|
||||
return is_dust
|
||||
|
||||
@locked
|
||||
def add_sweep_input(self, sweep_info: 'SweepInfo') -> None:
|
||||
|
||||
Reference in New Issue
Block a user