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

Function next_size

common/psbt_internal.c:11–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11static bool next_size(const u8 **cursor, size_t *max, size_t *size)
12{
13 size_t len;
14 varint_t varint;
15
16 if (*max < 1)
17 return false;
18
19 len = varint_get(*cursor, *max, &varint);
20
21 if (len < 1)
22 return false;
23
24 if (*max < len) {
25 *max = 0;
26 return false;
27 }
28
29 *cursor += len;
30 *max -= len;
31 *size = varint;
32 return true;
33}
34
35static u8 *next_script(const tal_t *ctx, const u8 **cursor, size_t *max)
36{

Callers 2

next_scriptFunction · 0.85

Calls 1

varint_getFunction · 0.85

Tested by

no test coverage detected