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