| 88 | } |
| 89 | |
| 90 | static void print_basepoints(const char *desc, |
| 91 | const struct secrets *secrets, |
| 92 | const struct sha256 *shaseed, |
| 93 | const struct basepoints *basepoints, |
| 94 | const struct pubkey *fundingkey, |
| 95 | u64 commitnum) |
| 96 | { |
| 97 | struct secret per_commitment_secret; |
| 98 | struct pubkey per_commitment_point; |
| 99 | |
| 100 | printf("## %s\n", desc); |
| 101 | printf("# funding_privkey=%s\n", |
| 102 | fmt_secret(NULL, &secrets->funding_privkey.secret)); |
| 103 | printf("funding_pubkey=%s\n", |
| 104 | fmt_pubkey(NULL, fundingkey)); |
| 105 | printf("# revocation_basepoint_secret=%s\n", |
| 106 | fmt_secret(NULL, |
| 107 | &secrets->revocation_basepoint_secret)); |
| 108 | printf("revocation_basepoint=%s\n", |
| 109 | fmt_pubkey(NULL, &basepoints->revocation)); |
| 110 | printf("# payment_basepoint_secret=%s\n", |
| 111 | fmt_secret(NULL, |
| 112 | &secrets->payment_basepoint_secret)); |
| 113 | printf("payment_basepoint=%s\n", |
| 114 | fmt_pubkey(NULL, &basepoints->payment)); |
| 115 | printf("# delayed_payment_basepoint_secret=%s\n", |
| 116 | fmt_secret(NULL, |
| 117 | &secrets->delayed_payment_basepoint_secret)); |
| 118 | printf("delayed_payment_basepoint=%s\n", |
| 119 | fmt_pubkey(NULL, &basepoints->delayed_payment)); |
| 120 | printf("# htlc_basepoint_secret=%s\n", |
| 121 | fmt_secret(NULL, |
| 122 | &secrets->htlc_basepoint_secret)); |
| 123 | printf("htlc_basepoint=%s\n", |
| 124 | fmt_pubkey(NULL, &basepoints->htlc)); |
| 125 | if (!per_commit_secret(shaseed, &per_commitment_secret, commitnum)) |
| 126 | errx(1, "Bad deriving %s per_commitment_secret #%"PRIu64, |
| 127 | desc, commitnum); |
| 128 | if (!per_commit_point(shaseed, &per_commitment_point, commitnum)) |
| 129 | errx(1, "Bad deriving %s per_commitment_point #%"PRIu64, |
| 130 | desc, commitnum); |
| 131 | printf("# shachain seed=%s\n", |
| 132 | fmt_sha256(NULL, shaseed)); |
| 133 | printf("# per_commitment_secret %"PRIu64"=%s\n", |
| 134 | commitnum, |
| 135 | fmt_secret(NULL, &per_commitment_secret)); |
| 136 | printf("per_commitment_point %"PRIu64"=%s\n\n", |
| 137 | commitnum, |
| 138 | fmt_pubkey(NULL, &per_commitment_point)); |
| 139 | } |
| 140 | |
| 141 | static int parse_config(char *argv[], |
| 142 | struct channel_config *config, |
no test coverage detected