mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
cnct: resolve anchors post-confirmation
Sweeping anchors and being able to bump the fee was already added in a previous commit. This commit extends anchor sweeping with an anchor resolver object that becomes active after the commitment tx confirms. At that point, the anchors do not serve the purpose of getting the commitment tranaction confirmed anymore. It is however still possible to reclaim some of their value if using a low fee rate.
This commit is contained in:
@@ -94,12 +94,14 @@ func (i *commitSweepResolverTestContext) waitForResult() {
|
||||
}
|
||||
|
||||
type mockSweeper struct {
|
||||
sweptInputs chan input.Input
|
||||
sweptInputs chan input.Input
|
||||
updatedInputs chan wire.OutPoint
|
||||
}
|
||||
|
||||
func newMockSweeper() *mockSweeper {
|
||||
return &mockSweeper{
|
||||
sweptInputs: make(chan input.Input),
|
||||
sweptInputs: make(chan input.Input),
|
||||
updatedInputs: make(chan wire.OutPoint),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +127,18 @@ func (s *mockSweeper) RelayFeePerKW() chainfee.SatPerKWeight {
|
||||
return 253
|
||||
}
|
||||
|
||||
func (s *mockSweeper) UpdateParams(input wire.OutPoint,
|
||||
params sweep.ParamsUpdate) (chan sweep.Result, error) {
|
||||
|
||||
s.updatedInputs <- input
|
||||
|
||||
result := make(chan sweep.Result, 1)
|
||||
result <- sweep.Result{
|
||||
Tx: &wire.MsgTx{},
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
var _ UtxoSweeper = &mockSweeper{}
|
||||
|
||||
// TestCommitSweepResolverNoDelay tests resolution of a direct commitment output
|
||||
|
||||
Reference in New Issue
Block a user