mirror of
https://github.com/lightninglabs/aperture.git
synced 2026-01-31 07:04:26 +01:00
multi: add disable authenticator option
To make it easier to use aperture in a setup where we only need its proxy functionality but not its LSAT capabilities, we add the option to disable the authenticator. This makes it possible to run aperture without needing to connect it to an lnd node.
This commit is contained in:
committed by
Oliver Gugger
parent
5061b659c9
commit
0206ecb031
25
aperture.go
25
aperture.go
@@ -161,15 +161,18 @@ func (a *Aperture) Start(errChan chan error) error {
|
||||
Value: price,
|
||||
}, nil
|
||||
}
|
||||
a.challenger, err = NewLndChallenger(
|
||||
a.cfg.Authenticator, genInvoiceReq, errChan,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = a.challenger.Start()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
if !a.cfg.Authenticator.Disable {
|
||||
a.challenger, err = NewLndChallenger(
|
||||
a.cfg.Authenticator, genInvoiceReq, errChan,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = a.challenger.Start()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Create the proxy and connect it to lnd.
|
||||
@@ -267,7 +270,9 @@ func (a *Aperture) UpdateServices(services []*proxy.Service) error {
|
||||
func (a *Aperture) Stop() error {
|
||||
var returnErr error
|
||||
|
||||
a.challenger.Stop()
|
||||
if a.challenger != nil {
|
||||
a.challenger.Stop()
|
||||
}
|
||||
|
||||
// Shut down our client and server connections now. This should cause
|
||||
// the first goroutine to quit.
|
||||
|
||||
Reference in New Issue
Block a user