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

Function varint_size

bitcoin/varint.c:4–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <bitcoin/varint.h>
3
4size_t varint_size(varint_t v)
5{
6 if (v < 0xfd)
7 return 1;
8 if (v <= 0xffff)
9 return 3;
10 if (v <= 0xffffffff)
11 return 5;
12 return 9;
13}
14
15size_t varint_put(u8 buf[VARINT_MAX_LEN], varint_t v)
16{

Callers 4

bitcoin_tx_core_weightFunction · 0.85
bitcoin_tx_output_weightFunction · 0.85
psbt_input_weightFunction · 0.85
psbt_output_weightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected