MCPcopy Create free account
hub / github.com/ElementsProject/lightning / payment_cleanup

Function payment_cleanup

plugins/renepay/payment.c:52–66  ·  view source on GitHub ↗

A payment that finishes execution must clean its hidden state. */

Source from the content-addressed store, hash-verified

50
51/* A payment that finishes execution must clean its hidden state. */
52static 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 */
69bool payment_refresh(struct payment *p){

Callers 1

payment_finishFunction · 0.85

Calls 3

tal_freeFunction · 0.85
disabledmap_resetFunction · 0.70
routetracker_cleanupFunction · 0.70

Tested by

no test coverage detected