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

Function disabledmap_new

plugins/renepay/disabledmap.c:5–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <plugins/renepay/disabledmap.h>
4
5struct disabledmap *disabledmap_new(const tal_t *ctx)
6{
7 struct disabledmap *obj = tal(ctx, struct disabledmap);
8 if (!obj)
9 return NULL;
10
11 obj->disabled_map = tal(obj, struct scidd_map);
12 obj->warned_map = tal(obj, struct scidd_map);
13 obj->disabled_ctx = tal(obj, tal_t);
14 obj->warned_ctx = tal(obj, tal_t);
15 obj->disabled_nodes = tal_arr(obj, struct node_id, 0);
16
17 if (!obj->disabled_map || !obj->warned_map || !obj->disabled_nodes ||
18 !obj->disabled_ctx || !obj->warned_ctx)
19 return tal_free(obj);
20
21 scidd_map_init(obj->disabled_map);
22 scidd_map_init(obj->warned_map);
23 return obj;
24}
25
26// FIXME: check success
27void disabledmap_reset(struct disabledmap *p)

Callers 1

payment_newFunction · 0.70

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected