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

Function fromwire

wire/fromwire.c:23–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23const u8 *fromwire(const u8 **cursor, size_t *max, void *copy, size_t n)
24{
25 const u8 *p = *cursor;
26
27 if (*max < n) {
28 /* Just make sure we don't leak uninitialized mem! */
29 if (copy)
30 memset(copy, 0, n);
31 if (*cursor)
32 SUPERVERBOSE("less than encoding length");
33 return fromwire_fail(cursor, max);
34 }
35 *cursor += n;
36 *max -= n;
37 if (copy)
38 memcpy(copy, p, n);
39 return memcheck(p, n);
40}
41
42int fromwire_peektype(const u8 *cursor)
43{

Callers 15

fromwire_peektypeFunction · 0.70
fromwire_u8Function · 0.70
fromwire_u16Function · 0.70
fromwire_u32Function · 0.70
fromwire_u64Function · 0.70
fromwire_tlv_uintFunction · 0.70
fromwire_boolFunction · 0.70
fromwire_sha256Function · 0.70
fromwire_ripemd160Function · 0.70
fromwire_u8_arrayFunction · 0.70

Calls 1

fromwire_failFunction · 0.70

Tested by

no test coverage detected