mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
test/run-commit_tx: test static remotekey.
Allow generation of static-remote-key variants of testcases. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e7e8fa7b10
commit
7bc78c45b4
1 changed files with 13 additions and 4 deletions
|
@ -524,6 +524,11 @@ int main(int argc, const char *argv[])
|
|||
struct amount_msat to_local, to_remote;
|
||||
const struct htlc **htlcs, **htlc_map, **htlc_map2, **inv_htlcs;
|
||||
bool option_anchor_outputs = false;
|
||||
bool option_static_remotekey = false;
|
||||
|
||||
/* Allow us to check static-remotekey BOLT 3 vectors, too */
|
||||
if (argv[1] && streq(argv[1], "--static-remotekey"))
|
||||
option_static_remotekey = true;
|
||||
|
||||
chainparams = chainparams_for_network("bitcoin");
|
||||
|
||||
|
@ -715,10 +720,14 @@ int main(int argc, const char *argv[])
|
|||
printf("localkey: %s\n",
|
||||
type_to_string(tmpctx, struct pubkey, &localkey));
|
||||
|
||||
if (!derive_simple_key(&remote_payment_basepoint,
|
||||
&x_local_per_commitment_point,
|
||||
&remotekey))
|
||||
abort();
|
||||
if (option_static_remotekey)
|
||||
remotekey = remote_payment_basepoint;
|
||||
else {
|
||||
if (!derive_simple_key(&remote_payment_basepoint,
|
||||
&x_local_per_commitment_point,
|
||||
&remotekey))
|
||||
abort();
|
||||
}
|
||||
printf("remotekey: %s\n",
|
||||
type_to_string(tmpctx, struct pubkey, &remotekey));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue