Merge pull request #9033 from ziggie1984/non-anchor-channel-bump

error out when non-anchor channels are tried to bump the force close fee.
This commit is contained in:
Oliver Gugger authored and GitHub committed 2024-10-07 23:30:17 -06:00
commit 0dd58ee529
2 files changed
+14

No files matched your search

+9
View File
@@ -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