File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "bytes"
55 "context"
66 "fmt"
7- "sync"
87 "sync/atomic"
98
109 "github.com/btcsuite/btcd/btcec/v2"
@@ -49,8 +48,6 @@ type ManagerConfig struct {
4948
5049// Manager manages the address state machines.
5150type Manager struct {
52- sync.Mutex
53-
5451 cfg * ManagerConfig
5552
5653 currentHeight atomic.Int32
@@ -183,25 +180,9 @@ func (m *Manager) NewAddress(ctx context.Context) (*Parameters, error) {
183180// newAddress contains the body of the former NewAddress method and performs the
184181// actual address creation/lookup according to the requested type.
185182func (m * Manager ) newAddress (ctx context.Context ) (* Parameters , error ) {
186- // If there's already a static address in the database, we can return
187- // it.
188- m .Lock ()
189- addresses , err := m .cfg .Store .GetAllStaticAddresses (ctx )
190- if err != nil {
191- m .Unlock ()
192-
193- return nil , err
194- }
195- if len (addresses ) > 0 {
196- m .Unlock ()
197-
198- return addresses [0 ], nil
199- }
200- m .Unlock ()
201-
202183 // We are fetching a new L402 token from the server. There is one static
203184 // address per L402 token allowed.
204- err = m .cfg .FetchL402 (ctx )
185+ err : = m .cfg .FetchL402 (ctx )
205186 if err != nil {
206187 return nil , err
207188 }
You can’t perform that action at this time.
0 commit comments