@@ -3,14 +3,12 @@ package deposit
33import (
44 "context"
55 "errors"
6- "fmt"
76
87 "github.com/btcsuite/btcd/txscript"
98 "github.com/btcsuite/btcd/wire"
109 "github.com/lightninglabs/lndclient"
1110 "github.com/lightninglabs/loop/fsm"
1211 "github.com/lightninglabs/loop/staticaddr/address"
13- "github.com/lightninglabs/loop/staticaddr/script"
1412 "github.com/lightninglabs/loop/staticaddr/version"
1513 "github.com/lightningnetwork/lnd/input"
1614 "github.com/lightningnetwork/lnd/keychain"
@@ -137,15 +135,13 @@ type FSM struct {
137135
138136 params * address.Parameters
139137
140- address * script.StaticAddress
141-
142138 blockNtfnChan chan uint32
143139
144140 // quitChan stops after the FSM stops consuming blockNtfnChan.
145141 quitChan chan struct {}
146142
147143 // finalizedDepositChan is used to signal that the deposit has been
148- // finalized and the FSM can be removed from the manager's memory.
144+ // finalized, and the FSM can be removed from the manager's memory.
149145 finalizedDepositChan chan wire.OutPoint
150146}
151147
@@ -155,29 +151,17 @@ func NewFSM(ctx context.Context, deposit *Deposit, cfg *ManagerConfig,
155151 finalizedDepositChan chan wire.OutPoint ,
156152 recoverStateMachine bool ) (* FSM , error ) {
157153
158- params , err := cfg .AddressManager .GetStaticAddressParameters (ctx )
159- if err != nil {
160- return nil , fmt .Errorf ("unable to get static address " +
161- "parameters: %w" , err )
162- }
163-
164- address , err := cfg .AddressManager .GetStaticAddress (ctx )
165- if err != nil {
166- return nil , fmt .Errorf ("unable to get static address: %w" , err )
167- }
168-
169154 depoFsm := & FSM {
170155 cfg : cfg ,
171156 deposit : deposit ,
172- params : params ,
173- address : address ,
157+ params : deposit .AddressParams ,
174158 blockNtfnChan : make (chan uint32 ),
175159 quitChan : make (chan struct {}),
176160 finalizedDepositChan : finalizedDepositChan ,
177161 }
178162
179163 depositStates := depoFsm .DepositStatesV0 ()
180- switch params .ProtocolVersion {
164+ switch deposit . AddressParams .ProtocolVersion {
181165 case version .ProtocolVersion_V0 :
182166
183167 default :
0 commit comments