You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xpay: add xpay_attempt_start and xpay_attempt_end notifications.
Requested-by: Michael at Boltz
Signed-off-by: Rusty Russell <[email protected]>
Changelog-Added: Plugins: `xpay` now publishes `xpay_attempt_start` and `xpay_attempt_end` notifications on every payment send attempt.
Copy file name to clipboardExpand all lines: doc/developers-guide/plugin-development/event-notifications.md
+82Lines changed: 82 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -567,3 +567,85 @@ Where:
567
567
-`plugin_name`: The short name of the plugin.
568
568
-`plugin_path`: The full file path to the plugin executable.
569
569
-`methods`: An array of RPC method names that the plugin registered.
570
+
571
+
572
+
### `xpay_attempt_start` (v25.09 onward)
573
+
574
+
Emitted by `xpay` when part of a payment begins. `payment_hash` and
575
+
`groupid` uniquely identify this xpay invocation, and `partid` then identifies
576
+
this particular attempt to pay part of that.
577
+
578
+
`total_payment_msat` is the total amount (usually the invoice amount),
579
+
which will be the same across all parts, adn `attempt_msat` is the
580
+
amount being delivered to the destination by this part.
581
+
582
+
Each element in `hops` shows the amount going into the node (i.e. with
583
+
fees, `channel_in_msat`) and the amount we're telling it to send
584
+
to the other end (`channel_out_msat`). The `channel_out_msat` will
585
+
be equal to the next `channel_in_msat. The final
586
+
`channel_out_msat` will be equal to the `attempt_msat`.
587
+
588
+
The example shows a payment from this node via 1x2x3 (direction 1) to 035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d, then via 2x3x4 (direction 0) to 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59.
Emitted by `xpay` when part of a payment ends. `payment_hash`, `groupid` and `partid`
621
+
will match a previous `xpay_attempt_start`.
622
+
623
+
`status` will be "success" or "failure". `duration` will be a number of seconds, with 9 decimal places. This is the time between `xpay` telling lightningd to send the onion, to when `xpay` processes the response.
624
+
625
+
If `status` is "failure", there will always be an `error_message`: the other fields below
626
+
will be missing in the unusual case where the error onion is corrupted.
627
+
628
+
`failed_node_id`: If it's a non-local error, the source of the error.
629
+
`failed_short_channel_id`: if it's not the final node, the channel it's complaining about.
630
+
`failed_direction`: if it's not the final node, the channel direction.
631
+
`failed_msg`: the decrypted onion message, in hex, if it was valid.
632
+
`error_code`: the error code returned (present unless onion was corrupted).
633
+
`error_message`: always present: if `failed_node_id` is present it's just the name of the `error_code`, but otherwise it can be a more informative error from our own node.
0 commit comments