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

Function stack_number

bitcoin/script.c:123–135  ·  view source on GitHub ↗

Bitcoin script stack values are a special, special snowflake. * * They're little endian values, but 0 is an empty value. We only * handle single byte values here. */

Source from the content-addressed store, hash-verified

121 * They're little endian values, but 0 is an empty value. We only
122 * handle single byte values here. */
123static u8 *stack_number(const tal_t *ctx, unsigned int num)
124{
125 u8 val;
126
127 if (num == 0)
128 return tal_arr(ctx, u8, 0);
129
130 val = num;
131 assert(val == num);
132
133 /* We use tal_dup_arr since we want tal_count() to work */
134 return tal_dup_arr(ctx, u8, &val, 1, 0);
135}
136
137/* tal_count() gives the length of the script. */
138u8 *bitcoin_redeem_2of2(const tal_t *ctx,

Callers 3

bitcoin_witness_2of2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected