@@ -13,13 +13,13 @@ import (
1313)
1414
1515const (
16- defaultConfTarget = 3
16+ DefaultConfTarget = 3
1717)
1818
19- // PublishDepositExpirySweepAction creates and publishes the timeout transaction
20- // that spends the deposit from the static address timeout leaf to the
21- // predefined timeout sweep pkscript.
22- func (f * FSM ) PublishDepositExpirySweepAction (_ fsm.EventContext ) fsm.EventType {
19+ // PublishExpirySweepAction creates and publishes the timeout transaction that
20+ // spends the deposit from the static address timeout leaf to the predefined
21+ // timeout sweep pkscript.
22+ func (f * FSM ) PublishExpirySweepAction (_ fsm.EventContext ) fsm.EventType {
2323 msgTx := wire .NewMsgTx (2 )
2424
2525 params , err := f .cfg .AddressManager .GetStaticAddressParameters (f .ctx )
@@ -36,11 +36,11 @@ func (f *FSM) PublishDepositExpirySweepAction(_ fsm.EventContext) fsm.EventType
3636
3737 // Estimate the fee rate of an expiry spend transaction.
3838 feeRateEstimator , err := f .cfg .WalletKit .EstimateFeeRate (
39- f .ctx , defaultConfTarget ,
39+ f .ctx , DefaultConfTarget ,
4040 )
4141 if err != nil {
4242 return f .HandleError (fmt .Errorf ("timeout sweep fee " +
43- "estimation failed: %v " , err ))
43+ "estimation failed: %w " , err ))
4444 }
4545
4646 weight := script .ExpirySpendWeight ()
@@ -111,15 +111,15 @@ func (f *FSM) PublishDepositExpirySweepAction(_ fsm.EventContext) fsm.EventType
111111// before a timeout sweep is considered successful.
112112func (f * FSM ) WaitForExpirySweepAction (_ fsm.EventContext ) fsm.EventType {
113113 spendChan , errSpendChan , err := f .cfg .ChainNotifier .RegisterConfirmationsNtfn ( //nolint:lll
114- f .ctx , nil , f .deposit .TimeOutSweepPkScript , defaultConfTarget ,
114+ f .ctx , nil , f .deposit .TimeOutSweepPkScript , DefaultConfTarget ,
115115 int32 (f .deposit .ConfirmationHeight ),
116116 )
117117 if err != nil {
118118 return f .HandleError (err )
119119 }
120120
121121 select {
122- case err : = <- errSpendChan :
122+ case err = <- errSpendChan :
123123 log .Debugf ("error while sweeping expired deposit: %v" , err )
124124 return fsm .OnError
125125
@@ -148,9 +148,9 @@ func (f *FSM) SweptExpiredDepositAction(_ fsm.EventContext) fsm.EventType {
148148 return fsm .NoOp
149149}
150150
151- // WithdrawnDepositAction is the final action after a withdrawal. It signals to
151+ // FinalizeDepositAction is the final action after a withdrawal. It signals to
152152// the manager that the deposit has been swept and the FSM can be removed.
153- func (f * FSM ) WithdrawnDepositAction (_ fsm.EventContext ) fsm.EventType {
153+ func (f * FSM ) FinalizeDepositAction (_ fsm.EventContext ) fsm.EventType {
154154 select {
155155 case <- f .ctx .Done ():
156156 return fsm .OnError
0 commit comments