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 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 
@@ -178,25 +175,9 @@ func (m *Manager) NewAddress(ctx context.Context) (*Parameters, error) {
178175// newAddress contains the body of the former NewAddress method and performs the 
179176// actual address creation/lookup according to the requested type. 
180177func  (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- 
197178	// We are fetching a new L402 token from the server. There is one static 
198179	// address per L402 token allowed. 
199- 	err  =  m .cfg .FetchL402 (ctx )
180+ 	err  : =m .cfg .FetchL402 (ctx )
200181	if  err  !=  nil  {
201182		return  nil , err 
202183	}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments