| 302 | } |
| 303 | |
| 304 | static struct command_result *payment_finish(struct payment *p) |
| 305 | { |
| 306 | assert(p->status == PAYMENT_FAIL || p->status == PAYMENT_SUCCESS); |
| 307 | assert(!payment_commands_empty(p)); |
| 308 | struct command *cmd = p->cmd_array[0]; |
| 309 | |
| 310 | // notify all commands that the payment completed |
| 311 | for (size_t i = 1; i < tal_count(p->cmd_array); ++i) { |
| 312 | my_command_finish(p, p->cmd_array[i]); |
| 313 | } |
| 314 | |
| 315 | // set the payment into a valid final state |
| 316 | payment_cleanup(p); |
| 317 | |
| 318 | return my_command_finish(p, cmd); |
| 319 | } |
| 320 | |
| 321 | void payment_disable_chan(struct payment *p, struct short_channel_id_dir scidd, |
| 322 | enum log_level lvl, const char *fmt, ...) |
no test coverage detected