Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/release-notes/release-notes-0.21.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
the chain watch filter on restart. This was a pre-existing bug since
private taproot channels were first introduced.

* [Fixed a shutdown race in the
* [Fixed a shutdown race in the
channel link](https://github.com/lightningnetwork/lnd/pull/10719)
that could deadlock the invoice registry during concurrent peer disconnect.
The link now waits for `htlcManager` to fully exit before tearing down hodl
Expand All @@ -88,6 +88,13 @@
RBF close state machine does not yet thread through the `AuxCloser` hook
that overlay channels rely on to build aux-aware close transactions.

- [Fixed `BudgetInputSet.AddWalletInputs` to roll back partially-added
wallet inputs on error](https://github.com/lightningnetwork/lnd/pull/10723).
Previously, if adding a wallet input failed midway through the loop, any
inputs already appended to the set would remain, leaving it in an
inconsistent state. The method now restores the input set to its original
state before returning the error.

# New Features

- [Basic Support](https://github.com/lightningnetwork/lnd/pull/9868) for onion
Expand Down
6 changes: 6 additions & 0 deletions sweep/tx_input_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,16 @@ func (b *BudgetInputSet) AddWalletInputs(wallet Wallet) error {
return utxos[i].Value < utxos[j].Value
})

// We'll track the initial number of inputs to ensure we can restore the
// set to its original state if we fail to add the required wallet
// inputs.
inputsBefore := len(b.inputs)

// Add wallet inputs to the set until the specified budget is covered.
for _, utxo := range utxos {
err := b.addWalletInput(utxo)
if err != nil {
b.inputs = b.inputs[:inputsBefore]
return err
}

Expand Down
Loading