notifications: notify htlc when peer offline

This commit is contained in:
Jesse de Wit
2023-06-15 15:55:09 +02:00
parent ddc0195b41
commit 09e8bd3cb6
4 changed files with 173 additions and 68 deletions

View File

@@ -79,6 +79,7 @@ func main() {
interceptStore := postgresql.NewPostgresInterceptStore(pool)
forwardingStore := postgresql.NewForwardingEventStore(pool)
notificationsStore := postgresql.NewNotificationsStore(pool)
notificationService := notifications.NewNotificationService(notificationsStore)
var interceptors []interceptor.HtlcInterceptor
for _, node := range nodes {
@@ -91,7 +92,7 @@ func main() {
client.StartListeners()
fwsync := lnd.NewForwardingHistorySync(client, interceptStore, forwardingStore)
interceptor := interceptor.NewInterceptor(client, node, interceptStore, feeEstimator, feeStrategy)
interceptor := interceptor.NewInterceptor(client, node, interceptStore, feeEstimator, feeStrategy, notificationService)
htlcInterceptor, err = lnd.NewLndHtlcInterceptor(node, client, fwsync, interceptor)
if err != nil {
log.Fatalf("failed to initialize LND interceptor: %v", err)
@@ -104,7 +105,7 @@ func main() {
log.Fatalf("failed to initialize CLN client: %v", err)
}
interceptor := interceptor.NewInterceptor(client, node, interceptStore, feeEstimator, feeStrategy)
interceptor := interceptor.NewInterceptor(client, node, interceptStore, feeEstimator, feeStrategy, notificationService)
htlcInterceptor, err = cln.NewClnHtlcInterceptor(node, client, interceptor)
if err != nil {
log.Fatalf("failed to initialize CLN interceptor: %v", err)