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

Function next_size

common/psbt_internal.c:13–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13static bool next_size(const u8 **cursor, size_t *max, size_t *size)
14{
15 size_t len;
16 varint_t varint;
17
18 if (*max < 1)
19 return false;
20
21 len = varint_get(*cursor, *max, &varint);
22
23 if (len < 1)
24 return false;
25
26 if (*max < len) {
27 *max = 0;
28 return false;
29 }
30
31 *cursor += len;
32 *max -= len;
33 *size = varint;
34 return true;
35}
36
37/* If @elements is non-NULL it must hold at least as many slots as the
38 * stack claims. A failure may have written a prefix; ignore it. */

Callers 3

parse_witness_stackFunction · 0.85
next_scriptFunction · 0.85

Calls 1

varint_getFunction · 0.85

Tested by

no test coverage detected