File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change 4
4
"bytes"
5
5
"context"
6
6
"fmt"
7
- "sync"
8
7
"sync/atomic"
9
8
10
9
"github.com/btcsuite/btcd/btcec/v2"
@@ -49,8 +48,6 @@ type ManagerConfig struct {
49
48
50
49
// Manager manages the address state machines.
51
50
type Manager struct {
52
- sync.Mutex
53
-
54
51
cfg * ManagerConfig
55
52
56
53
currentHeight atomic.Int32
@@ -178,25 +175,9 @@ func (m *Manager) NewAddress(ctx context.Context) (*Parameters, error) {
178
175
// newAddress contains the body of the former NewAddress method and performs the
179
176
// actual address creation/lookup according to the requested type.
180
177
func (m * Manager ) newAddress (ctx context.Context ) (* Parameters , error ) {
181
- // If there's already a static address in the database, we can return
182
- // it.
183
- m .Lock ()
184
- addresses , err := m .cfg .Store .GetAllStaticAddresses (ctx )
185
- if err != nil {
186
- m .Unlock ()
187
-
188
- return nil , err
189
- }
190
- if len (addresses ) > 0 {
191
- m .Unlock ()
192
-
193
- return addresses [0 ], nil
194
- }
195
- m .Unlock ()
196
-
197
178
// We are fetching a new L402 token from the server. There is one static
198
179
// address per L402 token allowed.
199
- err = m .cfg .FetchL402 (ctx )
180
+ err : = m .cfg .FetchL402 (ctx )
200
181
if err != nil {
201
182
return nil , err
202
183
}
You can’t perform that action at this time.
0 commit comments