clightning-dumpkeys

dump clightning output descriptors
git clone git://jb55.com/clightning-dumpkeys
Log | Files | Refs | README | LICENSE

commit 8be6be125a5bc16c9a92209058fe7a466819f29c
parent 01e348add552ec98788f271b771d4714b39e7c03
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 25 May 2019 08:29:26 -0700

only dump non-root descriptors

Diffstat:
Mcheck.c | 2--
Mclightning-dumpkeys.c | 8+++++---
Mshort_types.h | 2++
3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/check.c b/check.c @@ -5,8 +5,6 @@ #include <assert.h> #include <string.h> -#define streq(a, b) strcmp(a, b) == 0 - int main() { char checksum[9]; diff --git a/clightning-dumpkeys.c b/clightning-dumpkeys.c @@ -225,10 +225,12 @@ static void dump_bip32(struct ext_key *key, const char *name) { printf("%s\t%s public\n", out, name); - snprintf(cbuf, sizeof(cbuf), "combo(%s/*)", out); - descriptor_checksum(cbuf, strlen(cbuf), cbuf2, sizeof(cbuf2)); + if (!streq(name, "root")) { + snprintf(cbuf, sizeof(cbuf), "combo(%s/*)", out); + descriptor_checksum(cbuf, strlen(cbuf), cbuf2, sizeof(cbuf2)); - printf("%s#%s\t%s public descriptor\n", cbuf, cbuf2, name); + printf("%s#%s\t%s public descriptor\n", cbuf, cbuf2, name); + } wally_free_string(out); diff --git a/short_types.h b/short_types.h @@ -21,4 +21,6 @@ typedef int8_t s8; #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#define streq(a, b) strcmp(a, b) == 0 + #endif /* DK_SHORT_TYPES_H */