Owned by cmd, if cmd is deleted, then sendpay_success/sendpay_fail will * no longer be called. */
| 94 | /* Owned by cmd, if cmd is deleted, then sendpay_success/sendpay_fail will |
| 95 | * no longer be called. */ |
| 96 | static void |
| 97 | add_waitsendpay_waiter(struct lightningd *ld, |
| 98 | struct command *cmd, |
| 99 | const struct sha256 *payment_hash, |
| 100 | u64 partid, u64 groupid) |
| 101 | { |
| 102 | struct sendpay_command *pc = tal(cmd, struct sendpay_command); |
| 103 | |
| 104 | pc->payment_hash = *payment_hash; |
| 105 | pc->partid = partid; |
| 106 | pc->groupid = groupid; |
| 107 | pc->cmd = cmd; |
| 108 | list_add(&ld->waitsendpay_commands, &pc->list); |
| 109 | tal_add_destructor(pc, destroy_sendpay_command); |
| 110 | } |
| 111 | |
| 112 | /* Outputs fields, not a separate object*/ |
| 113 | void json_add_payment_fields(struct json_stream *response, |