1
0

ln_utxo_reserve

When we send max, decrease sent amount in order to keep some
reserve utxo, in order to be able to sweep lightning channels.
This commit is contained in:
ThomasV
2025-03-17 13:11:25 +01:00
parent 307f5d301e
commit b339b1e7e3
5 changed files with 86 additions and 17 deletions

View File

@@ -531,6 +531,10 @@ class TxEditor(WindowModalDialog):
# warn if spending unconf
if any((txin.block_height is not None and txin.block_height<=0) for txin in self.tx.inputs()):
messages.append(_('This transaction will spend unconfirmed coins.'))
# warn if a reserve utxo was added
if reserve_sats := sum(txo.value for txo in self.tx.outputs() if txo.is_utxo_reserve):
reserve_str = self.main_window.config.format_amount_and_units(reserve_sats)
messages.append(_('Could not spend max: a security reserve of {} was kept for your Lightning channels.').format(reserve_str))
# warn if we merge from mempool
if self.is_batching():
messages.append(_('This payment will be merged with another existing transaction.'))