aperture+challenger: add error channel to challenger

To make sure we can capture errors in the challenger's invoice
subscription, we hand the main error channel to the challenger so it can
report back errors on it.
This commit is contained in:
Oliver Gugger
2020-09-23 10:07:42 +02:00
parent 5237b07a6e
commit e1269a7f86
3 changed files with 23 additions and 8 deletions

View File

@@ -110,7 +110,10 @@ func run() error {
Value: price,
}, nil
}
challenger, err := NewLndChallenger(cfg.Authenticator, genInvoiceReq)
errChan := make(chan error)
challenger, err := NewLndChallenger(
cfg.Authenticator, genInvoiceReq, errChan,
)
if err != nil {
return err
}
@@ -164,7 +167,6 @@ func run() error {
)
log.Infof("Starting the server, listening on %s.", cfg.ListenAddr)
errChan := make(chan error)
wg.Add(1)
go func() {
defer wg.Done()