From 56a2c65477270353ea43a13b4d4dd5aa85f3ea3d Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Thu, 8 Apr 2021 21:07:15 +0200 Subject: [PATCH] router: use SetID as identifier for SendToRoute AMP-payments --- routing/router.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routing/router.go b/routing/router.go index 98136f5b2..205bd2149 100644 --- a/routing/router.go +++ b/routing/router.go @@ -1970,6 +1970,13 @@ func (r *ChannelRouter) SendToRoute(htlcHash lntypes.Hash, rt *route.Route) ( // hash as used for this HTLC. paymentIdentifier := htlcHash + // For AMP-payments, we'll use the setID as the unique ID for the + // overall payment. + amp := finalHop.AMP + if amp != nil { + paymentIdentifier = amp.SetID() + } + // Record this payment hash with the ControlTower, ensuring it is not // already in-flight. info := &channeldb.PaymentCreationInfo{