File tree Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Expand file tree Collapse file tree 1 file changed +0
-9
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
@@ -163,20 +160,15 @@ func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
163
160
164
161
// If there's already a static address in the database, we can return
165
162
// it.
166
- m .Lock ()
167
163
addresses , err := m .cfg .Store .GetAllStaticAddresses (ctx )
168
164
if err != nil {
169
- m .Unlock ()
170
-
171
165
return nil , 0 , err
172
166
}
173
167
if len (addresses ) > 0 {
174
168
clientPubKey := addresses [0 ].ClientPubkey
175
169
serverPubKey := addresses [0 ].ServerPubkey
176
170
expiry := int64 (addresses [0 ].Expiry )
177
171
178
- defer m .Unlock ()
179
-
180
172
address , err := m .GetTaprootAddress (
181
173
clientPubKey , serverPubKey , expiry ,
182
174
)
@@ -186,7 +178,6 @@ func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
186
178
187
179
return address , expiry , nil
188
180
}
189
- m .Unlock ()
190
181
191
182
// We are fetching a new L402 token from the server. There is one static
192
183
// address per L402 token allowed.
You can’t perform that action at this time.
0 commit comments