diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c index 6a0ff3093876..102a7bc604ce 100644 --- a/plugins/xpay/xpay.c +++ b/plugins/xpay/xpay.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -2427,6 +2428,9 @@ static struct payment *new_payment(const tal_t *ctx, { struct xpay *xpay = xpay_of(cmd->plugin); struct payment *payment = tal(ctx, struct payment); + /* Start tracing the payment until it is destroyed. */ + trace_span_start("xpay/payment", payment); + trace_span_suspend_may_free(payment); payment->plugin = cmd->plugin; payment->deadline = timemono_add(time_mono(), time_from_sec(retryfor));