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