mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
walletrpc: error out for non-anchor chans.
Return an error if a non-anchor channel is tried to be fee-bumped.
This commit is contained in:
parent
75eaaf7c5c
commit
6387c0ab50
1 changed files with 9 additions and 0 deletions
|
@ -1179,6 +1179,11 @@ func (w *WalletKit) BumpForceCloseFee(_ context.Context,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if !channel.ChanType.HasAnchors() {
|
||||
return nil, fmt.Errorf("not able to bump the fee of a " +
|
||||
"non-anchor channel")
|
||||
}
|
||||
|
||||
// Match pending sweeps with commitments of the channel for which a bump
|
||||
// is requested. Depending on the commitment state when force closing
|
||||
// the channel we might have up to 3 commitments to consider when
|
||||
|
@ -1237,6 +1242,10 @@ func (w *WalletKit) BumpForceCloseFee(_ context.Context,
|
|||
return commitSet.Contains(sweep.OutPoint.Hash)
|
||||
}, pendingSweeps)
|
||||
|
||||
if len(anchors) == 0 {
|
||||
return nil, fmt.Errorf("unable to find pending anchor outputs")
|
||||
}
|
||||
|
||||
// Filter all relevant anchor sweeps and update the sweep request.
|
||||
for _, anchor := range anchors {
|
||||
// Anchor cpfp bump request are predictable because they are
|
||||
|
|
Loading…
Add table
Reference in a new issue