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 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 
@@ -186,20 +183,15 @@ func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
186183
187184	// If there's already a static address in the database, we can return 
188185	// it. 
189- 	m .Lock ()
190186	addresses , err  :=  m .cfg .Store .GetAllStaticAddresses (ctx )
191187	if  err  !=  nil  {
192- 		m .Unlock ()
193- 
194188		return  nil , 0 , err 
195189	}
196190	if  len (addresses ) >  0  {
197191		clientPubKey  :=  addresses [0 ].ClientPubkey 
198192		serverPubKey  :=  addresses [0 ].ServerPubkey 
199193		expiry  :=  int64 (addresses [0 ].Expiry )
200194
201- 		defer  m .Unlock ()
202- 
203195		address , err  :=  m .GetTaprootAddress (
204196			clientPubKey , serverPubKey , expiry ,
205197		)
@@ -209,7 +201,6 @@ func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
209201
210202		return  address , expiry , nil 
211203	}
212- 	m .Unlock ()
213204
214205	// We are fetching a new L402 token from the server. There is one static 
215206	// address per L402 token allowed. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments