A payment that finishes execution must clean its hidden state. */
| 50 | |
| 51 | /* A payment that finishes execution must clean its hidden state. */ |
| 52 | static void payment_cleanup(struct payment *p) |
| 53 | { |
| 54 | p->exec_state = INVALID_STATE; |
| 55 | tal_resize(&p->cmd_array, 0); |
| 56 | p->local_gossmods = tal_free(p->local_gossmods); |
| 57 | |
| 58 | /* FIXME: for optimization, a cleanup should prune all the data that has |
| 59 | * no use after a payent is completed. The entire disablemap structure |
| 60 | * is no longer needed, hence I guess we should free it not just reset |
| 61 | * it. */ |
| 62 | disabledmap_reset(p->disabledmap); |
| 63 | p->waitresult_timer = tal_free(p->waitresult_timer); |
| 64 | |
| 65 | routetracker_cleanup(p->routetracker); |
| 66 | } |
| 67 | |
| 68 | /* Sets state values to ongoing payment */ |
| 69 | bool payment_refresh(struct payment *p){ |
no test coverage detected