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. */
| 121 | * They're little endian values, but 0 is an empty value. We only |
| 122 | * handle single byte values here. */ |
| 123 | static 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. */ |
| 138 | u8 *bitcoin_redeem_2of2(const tal_t *ctx, |
no outgoing calls
no test coverage detected