Skip to content

Commit 1fe6396

Browse files
committed
staticaddr: remove single-address restriction
1 parent 9d2b77d commit 1fe6396

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

staticaddr/address/manager.go

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -181,30 +181,8 @@ func (m *Manager) NewAddress(ctx context.Context) (*btcutil.AddressTaproot,
181181
func (m *Manager) newAddress(ctx context.Context) (*btcutil.AddressTaproot,
182182
int64, error) {
183183

184-
// If there's already a static address in the database, we can return
185-
// it.
186-
addresses, err := m.cfg.Store.GetAllStaticAddresses(ctx)
187-
if err != nil {
188-
return nil, 0, err
189-
}
190-
if len(addresses) > 0 {
191-
clientPubKey := addresses[0].ClientPubkey
192-
serverPubKey := addresses[0].ServerPubkey
193-
expiry := int64(addresses[0].Expiry)
194-
195-
address, err := m.GetTaprootAddress(
196-
clientPubKey, serverPubKey, expiry,
197-
)
198-
if err != nil {
199-
return nil, 0, err
200-
}
201-
202-
return address, expiry, nil
203-
}
204-
205-
// We are fetching a new L402 token from the server. There is one static
206-
// address per L402 token allowed.
207-
err = m.cfg.FetchL402(ctx)
184+
// We are fetching a new L402 token from the server.
185+
err := m.cfg.FetchL402(ctx)
208186
if err != nil {
209187
return nil, 0, err
210188
}

0 commit comments

Comments
 (0)