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
@@ -207,20 +204,15 @@ func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
207
204
208
205
// If there's already a static address in the database, we can return
209
206
// it.
210
- m .Lock ()
211
207
addresses , err := m .cfg .Store .GetAllStaticAddresses (ctx )
212
208
if err != nil {
213
- m .Unlock ()
214
-
215
209
return nil , 0 , err
216
210
}
217
211
if len (addresses ) > 0 {
218
212
clientPubKey := addresses [0 ].ClientPubkey
219
213
serverPubKey := addresses [0 ].ServerPubkey
220
214
expiry := int64 (addresses [0 ].Expiry )
221
215
222
- defer m .Unlock ()
223
-
224
216
address , err := m .GetTaprootAddress (
225
217
clientPubKey , serverPubKey , expiry ,
226
218
)
@@ -230,7 +222,6 @@ func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
230
222
231
223
return address , expiry , nil
232
224
}
233
- m .Unlock ()
234
225
235
226
// We are fetching a new L402 token from the server. There is one static
236
227
// address per L402 token allowed.
You can’t perform that action at this time.
0 commit comments