| 630 | } |
| 631 | |
| 632 | static void outgoing_notify_start(const struct attempt *attempt) |
| 633 | { |
| 634 | struct json_stream *js = plugin_notification_start(NULL, "pay_part_start"); |
| 635 | json_add_attempt_fields(js, attempt); |
| 636 | json_add_amount_msat(js, "total_payment_msat", attempt->payment->amount); |
| 637 | json_add_amount_msat(js, "attempt_msat", attempt->amount); |
| 638 | json_array_start(js, "hops"); |
| 639 | for (size_t i = 0; i < tal_count(attempt->hops); i++) { |
| 640 | const struct hop *hop = &attempt->hops[i]; |
| 641 | json_object_start(js, NULL); |
| 642 | json_add_pubkey(js, "next_node", &hop->next_node); |
| 643 | json_add_short_channel_id(js, "short_channel_id", hop->scidd.scid); |
| 644 | json_add_u32(js, "direction", hop->scidd.dir); |
| 645 | json_add_amount_msat(js, "channel_in_msat", hop->amount_in); |
| 646 | json_add_amount_msat(js, "channel_out_msat", hop->amount_out); |
| 647 | json_object_end(js); |
| 648 | } |
| 649 | json_array_end(js); |
| 650 | plugin_notification_end(attempt->payment->plugin, js); |
| 651 | } |
| 652 | |
| 653 | static void outgoing_notify_success(const struct attempt *attempt) |
| 654 | { |
no test coverage detected