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

Function pull_all

common/bolt11.c:92–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92static void *pull_all(const tal_t *ctx,
93 struct hash_u5 *hu5,
94 const u5 **data, size_t *data_len,
95 bool pad,
96 const char **err)
97{
98 void *ret;
99 size_t retlen;
100
101 if (pad)
102 retlen = (*data_len * 5 + 7) / 8;
103 else
104 retlen = (*data_len * 5) / 8;
105
106 ret = tal_arr(ctx, u8, retlen);
107 *err = pull_bits(hu5, data, data_len, ret, *data_len * 5, pad);
108 if (*err)
109 return tal_free(ret);
110 return ret;
111}
112
113/* Frees bolt11, returns NULL. */
114static struct bolt11 *decode_fail(struct bolt11 *b11, const char **fail,

Callers 6

unknown_fieldFunction · 0.85
decode_dFunction · 0.85
decode_fFunction · 0.85
decode_rFunction · 0.85
decode_9Function · 0.85
decode_mFunction · 0.85

Calls 2

pull_bitsFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected