You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Make a copy of the current inputs. If the wallet doesn't have enough
// utxos to cover the budget, we will revert the current set to its
// original state by removing the added wallet inputs.
originalInputs:=b.copyInputs()
// Add wallet inputs to the set until the specified budget is covered.
for_, utxo:=rangeutxos {
input, err:=createWalletTxInput(utxo)
iferr!=nil {
returnerr
}
pi:=SweeperInput{
Input: input,
params: Params{
DeadlineHeight: fn.Some(b.deadlineHeight),
},
}
b.addInput(pi)
// Return if we've reached the minimum output amount.
if!b.NeedWalletInput() {
returnnil
}
}
// The wallet doesn't have enough utxos to cover the budget. Revert the
// input set to its original state.
b.inputs=originalInputs
returnErrNotEnoughInputs
But if createWalletTxInput returns an error, the original inputs are not restored.
Solution
Today createWalletTxInput shouldn't ever return an error, though it may in the future if a new witness type is added. We should unify all error paths in AddWalletInputs to ensure inputs are restored.
The text was updated successfully, but these errors were encountered:
BudgetInputSet.AddWalletInputs
currently restores the original inputs if there aren't enough wallet inputs to meet the budget.lnd/sweep/tx_input_set.go
Lines 297 to 327 in 9d358bc
But if
createWalletTxInput
returns an error, the original inputs are not restored.Solution
Today
createWalletTxInput
shouldn't ever return an error, though it may in the future if a new witness type is added. We should unify all error paths inAddWalletInputs
to ensure inputs are restored.The text was updated successfully, but these errors were encountered: