multi: thread context through InitPayment

This commit is contained in:
ziggie committed 2026-02-25 08:02:23 +01:00
1 parent 10062ca9ac
commit 60026494b1
9 files changed
+46 -39

No files matched your search

+4 -2
View File
@@ -967,6 +967,8 @@ func spewPayment(payment *LightningPayment) lnutils.LogClosure {
func (r *ChannelRouter) PreparePayment(payment *LightningPayment) (
PaymentSession, shards.ShardTracker, error) {
ctx := context.TODO()
// Assemble any custom data we want to send to the first hop only.
var firstHopData fn.Option[tlv.Blob]
if len(payment.FirstHopCustomRecords) > 0 {
@@ -1026,7 +1028,7 @@ func (r *ChannelRouter) PreparePayment(payment *LightningPayment) (
)
}
err = r.cfg.Control.InitPayment(payment.Identifier(), info)
err = r.cfg.Control.InitPayment(ctx, payment.Identifier(), info)
if err != nil {
return nil, nil, err
}
@@ -1131,7 +1133,7 @@ func (r *ChannelRouter) sendToRoute(htlcHash lntypes.Hash, rt *route.Route,
FirstHopCustomRecords: firstHopCustomRecords,
}
err := r.cfg.Control.InitPayment(paymentIdentifier, info)
err := r.cfg.Control.InitPayment(ctx, paymentIdentifier, info)
switch {
// If this is an MPP attempt and the hash is already registered with
// the database, we can go on to launch the shard.