What changed, and why it matters
This commit only adds extra debug and info log messages. It does not change any program behavior, transaction logic, or security checks. The change makes it easier for developers to see when a small Lightning UTXO is considered 'dust' (too tiny to spend economically) or when fee estimates are unavailable. There is no security fix or vulnerability here.
No action needed. This is a diagnostic logging improvement with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds logging in two exception handlers in lnwatcher.py (BelowDustLimit, NoDynamicFeeEstimates) and restructures a log line in txbatcher.py to include the boolean result of the existing dust check. No functional code paths, fee calculations, thresholds, or sweep logic are modified.
Changed components
electrum/lnwatcher.pyelectrum/txbatcher.pyInspect captured patch +5 / −2
diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py
index 8041eac..d683652 100644
--- a/electrum/lnwatcher.py
+++ b/electrum/lnwatcher.py
@@ -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
diff --git a/electrum/txbatcher.py b/electrum/txbatcher.py
index 6451bfb..03ede4c 100644
--- a/electrum/txbatcher.py
+++ b/electrum/txbatcher.py
@@ -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:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.