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

Function fromwire_compact_size

wallet/psbt_fixup.c:34–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34static u64 fromwire_compact_size(const u8 **cursor, size_t *max)
35{
36 u8 v;
37 le16 v16;
38 le32 v32;
39 le64 v64;
40
41 v = fromwire_u8(cursor, max);
42 switch (v) {
43 case 0xfd:
44 fromwire(cursor, max, &v16, sizeof(v16));
45 return le16_to_cpu(v16);
46 case 0xfe:
47 fromwire(cursor, max, &v32, sizeof(v32));
48 return le32_to_cpu(v32);
49 case 0xff:
50 fromwire(cursor, max, &v64, sizeof(v64));
51 return le64_to_cpu(v64);
52 default:
53 return v;
54 }
55}
56
57static size_t fromwire_compact_len(const u8 **cursor, size_t *max)
58{

Callers 2

fromwire_compact_lenFunction · 0.85
fromwire_keypairFunction · 0.85

Calls 5

le16_to_cpuFunction · 0.85
le32_to_cpuFunction · 0.85
le64_to_cpuFunction · 0.85
fromwire_u8Function · 0.50
fromwireFunction · 0.50

Tested by

no test coverage detected