| 410 | } |
| 411 | |
| 412 | char *rune_to_string(const tal_t *ctx, const struct rune *rune) |
| 413 | { |
| 414 | u8 hash32[32]; |
| 415 | struct wbuf wbuf; |
| 416 | |
| 417 | /* We're going to prepend hash (in hex), plus colon */ |
| 418 | wbuf.off = sizeof(hash32) * 2 + 1; |
| 419 | wbuf.len = 128; |
| 420 | wbuf.buf = tal_arr(ctx, char, wbuf.len); |
| 421 | |
| 422 | to_string(&wbuf, rune, hash32); |
| 423 | hex_encode(hash32, sizeof(hash32), wbuf.buf, sizeof(hash32) * 2 + 1); |
| 424 | wbuf.buf[sizeof(hash32) * 2] = ':'; |
| 425 | return wbuf.buf; |
| 426 | } |