mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
openingd: update to BOLT with htlckey.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
fc05779f78
commit
46f2e17905
@ -442,7 +442,8 @@ static bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id)
|
|||||||
&ignored_u16, &ignored_u16,
|
&ignored_u16, &ignored_u16,
|
||||||
&ignored_pubkey, &ignored_pubkey,
|
&ignored_pubkey, &ignored_pubkey,
|
||||||
&ignored_pubkey, &ignored_pubkey,
|
&ignored_pubkey, &ignored_pubkey,
|
||||||
&ignored_pubkey, &ignored_u8))
|
&ignored_pubkey, &ignored_pubkey,
|
||||||
|
&ignored_u8))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -253,6 +253,7 @@ static u8 *funder_channel(struct state *state,
|
|||||||
&ours->revocation,
|
&ours->revocation,
|
||||||
&ours->payment,
|
&ours->payment,
|
||||||
&ours->delayed_payment,
|
&ours->delayed_payment,
|
||||||
|
&ours->htlc,
|
||||||
&state->next_per_commit[LOCAL],
|
&state->next_per_commit[LOCAL],
|
||||||
channel_flags);
|
channel_flags);
|
||||||
if (!sync_crypto_write(&state->cs, PEER_FD, msg))
|
if (!sync_crypto_write(&state->cs, PEER_FD, msg))
|
||||||
@ -287,13 +288,11 @@ static u8 *funder_channel(struct state *state,
|
|||||||
&theirs.revocation,
|
&theirs.revocation,
|
||||||
&theirs.payment,
|
&theirs.payment,
|
||||||
&theirs.delayed_payment,
|
&theirs.delayed_payment,
|
||||||
|
&theirs.htlc,
|
||||||
&state->next_per_commit[REMOTE]))
|
&state->next_per_commit[REMOTE]))
|
||||||
peer_failed(PEER_FD, &state->cs, &state->channel_id,
|
peer_failed(PEER_FD, &state->cs, &state->channel_id,
|
||||||
"Parsing accept_channel %s", tal_hex(msg, msg));
|
"Parsing accept_channel %s", tal_hex(msg, msg));
|
||||||
|
|
||||||
/* FIXME */
|
|
||||||
theirs.htlc = theirs.payment;
|
|
||||||
|
|
||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
* The `temporary_channel_id` MUST be the same as the
|
* The `temporary_channel_id` MUST be the same as the
|
||||||
@ -493,15 +492,13 @@ static u8 *fundee_channel(struct state *state,
|
|||||||
&theirs.revocation,
|
&theirs.revocation,
|
||||||
&theirs.payment,
|
&theirs.payment,
|
||||||
&theirs.delayed_payment,
|
&theirs.delayed_payment,
|
||||||
|
&theirs.htlc,
|
||||||
&state->next_per_commit[REMOTE],
|
&state->next_per_commit[REMOTE],
|
||||||
&channel_flags))
|
&channel_flags))
|
||||||
peer_failed(PEER_FD, &state->cs, NULL,
|
peer_failed(PEER_FD, &state->cs, NULL,
|
||||||
"Bad open_channel %s",
|
"Bad open_channel %s",
|
||||||
tal_hex(peer_msg, peer_msg));
|
tal_hex(peer_msg, peer_msg));
|
||||||
|
|
||||||
/* FIXME */
|
|
||||||
theirs.htlc = theirs.payment;
|
|
||||||
|
|
||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
* The receiving node MUST reject the channel if the `chain_hash` value
|
* The receiving node MUST reject the channel if the `chain_hash` value
|
||||||
@ -567,6 +564,7 @@ static u8 *fundee_channel(struct state *state,
|
|||||||
&ours->revocation,
|
&ours->revocation,
|
||||||
&ours->payment,
|
&ours->payment,
|
||||||
&ours->delayed_payment,
|
&ours->delayed_payment,
|
||||||
|
&ours->htlc,
|
||||||
&state->next_per_commit[LOCAL]);
|
&state->next_per_commit[LOCAL]);
|
||||||
|
|
||||||
if (!sync_crypto_write(&state->cs, PEER_FD, take(msg)))
|
if (!sync_crypto_write(&state->cs, PEER_FD, take(msg)))
|
||||||
|
@ -30,8 +30,9 @@ open_channel,120,funding_pubkey,33
|
|||||||
open_channel,153,revocation_basepoint,33
|
open_channel,153,revocation_basepoint,33
|
||||||
open_channel,186,payment_basepoint,33
|
open_channel,186,payment_basepoint,33
|
||||||
open_channel,219,delayed_payment_basepoint,33
|
open_channel,219,delayed_payment_basepoint,33
|
||||||
open_channel,252,first_per_commitment_point,33
|
open_channel,252,htlc_basepoint,33
|
||||||
open_channel,285,channel_flags,1
|
open_channel,285,first_per_commitment_point,33
|
||||||
|
open_channel,318,channel_flags,1
|
||||||
accept_channel,33
|
accept_channel,33
|
||||||
accept_channel,0,temporary_channel_id,32
|
accept_channel,0,temporary_channel_id,32
|
||||||
accept_channel,32,dust_limit_satoshis,8
|
accept_channel,32,dust_limit_satoshis,8
|
||||||
@ -45,7 +46,8 @@ accept_channel,72,funding_pubkey,33
|
|||||||
accept_channel,105,revocation_basepoint,33
|
accept_channel,105,revocation_basepoint,33
|
||||||
accept_channel,138,payment_basepoint,33
|
accept_channel,138,payment_basepoint,33
|
||||||
accept_channel,171,delayed_payment_basepoint,33
|
accept_channel,171,delayed_payment_basepoint,33
|
||||||
accept_channel,204,first_per_commitment_point,33
|
accept_channel,204,htlc_basepoint,33
|
||||||
|
accept_channel,237,first_per_commitment_point,33
|
||||||
funding_created,34
|
funding_created,34
|
||||||
funding_created,0,temporary_channel_id,32
|
funding_created,0,temporary_channel_id,32
|
||||||
funding_created,32,funding_txid,32
|
funding_created,32,funding_txid,32
|
||||||
|
@ -109,6 +109,7 @@ struct msg_accept_channel {
|
|||||||
struct pubkey revocation_basepoint;
|
struct pubkey revocation_basepoint;
|
||||||
struct pubkey payment_basepoint;
|
struct pubkey payment_basepoint;
|
||||||
struct pubkey delayed_payment_basepoint;
|
struct pubkey delayed_payment_basepoint;
|
||||||
|
struct pubkey htlc_basepoint;
|
||||||
struct pubkey first_per_commitment_point;
|
struct pubkey first_per_commitment_point;
|
||||||
};
|
};
|
||||||
struct msg_update_fulfill_htlc {
|
struct msg_update_fulfill_htlc {
|
||||||
@ -180,6 +181,7 @@ struct msg_open_channel {
|
|||||||
struct pubkey revocation_basepoint;
|
struct pubkey revocation_basepoint;
|
||||||
struct pubkey payment_basepoint;
|
struct pubkey payment_basepoint;
|
||||||
struct pubkey delayed_payment_basepoint;
|
struct pubkey delayed_payment_basepoint;
|
||||||
|
struct pubkey htlc_basepoint;
|
||||||
struct pubkey first_per_commitment_point;
|
struct pubkey first_per_commitment_point;
|
||||||
u8 channel_flags;
|
u8 channel_flags;
|
||||||
};
|
};
|
||||||
@ -273,6 +275,7 @@ static void *towire_struct_open_channel(const tal_t *ctx,
|
|||||||
&s->revocation_basepoint,
|
&s->revocation_basepoint,
|
||||||
&s->payment_basepoint,
|
&s->payment_basepoint,
|
||||||
&s->delayed_payment_basepoint,
|
&s->delayed_payment_basepoint,
|
||||||
|
&s->htlc_basepoint,
|
||||||
&s->first_per_commitment_point,
|
&s->first_per_commitment_point,
|
||||||
s->channel_flags);
|
s->channel_flags);
|
||||||
}
|
}
|
||||||
@ -297,6 +300,7 @@ static struct msg_open_channel *fromwire_struct_open_channel(const tal_t *ctx, c
|
|||||||
&s->revocation_basepoint,
|
&s->revocation_basepoint,
|
||||||
&s->payment_basepoint,
|
&s->payment_basepoint,
|
||||||
&s->delayed_payment_basepoint,
|
&s->delayed_payment_basepoint,
|
||||||
|
&s->htlc_basepoint,
|
||||||
&s->first_per_commitment_point,
|
&s->first_per_commitment_point,
|
||||||
&s->channel_flags))
|
&s->channel_flags))
|
||||||
return s;
|
return s;
|
||||||
@ -318,6 +322,7 @@ static void *towire_struct_accept_channel(const tal_t *ctx,
|
|||||||
&s->funding_pubkey,
|
&s->funding_pubkey,
|
||||||
&s->revocation_basepoint,
|
&s->revocation_basepoint,
|
||||||
&s->payment_basepoint,
|
&s->payment_basepoint,
|
||||||
|
&s->htlc_basepoint,
|
||||||
&s->delayed_payment_basepoint,
|
&s->delayed_payment_basepoint,
|
||||||
&s->first_per_commitment_point);
|
&s->first_per_commitment_point);
|
||||||
}
|
}
|
||||||
@ -338,6 +343,7 @@ static struct msg_accept_channel *fromwire_struct_accept_channel(const tal_t *ct
|
|||||||
&s->funding_pubkey,
|
&s->funding_pubkey,
|
||||||
&s->revocation_basepoint,
|
&s->revocation_basepoint,
|
||||||
&s->payment_basepoint,
|
&s->payment_basepoint,
|
||||||
|
&s->htlc_basepoint,
|
||||||
&s->delayed_payment_basepoint,
|
&s->delayed_payment_basepoint,
|
||||||
&s->first_per_commitment_point))
|
&s->first_per_commitment_point))
|
||||||
return s;
|
return s;
|
||||||
@ -1025,6 +1031,7 @@ int main(void)
|
|||||||
set_pubkey(&oc.revocation_basepoint);
|
set_pubkey(&oc.revocation_basepoint);
|
||||||
set_pubkey(&oc.payment_basepoint);
|
set_pubkey(&oc.payment_basepoint);
|
||||||
set_pubkey(&oc.delayed_payment_basepoint);
|
set_pubkey(&oc.delayed_payment_basepoint);
|
||||||
|
set_pubkey(&oc.htlc_basepoint);
|
||||||
set_pubkey(&oc.first_per_commitment_point);
|
set_pubkey(&oc.first_per_commitment_point);
|
||||||
|
|
||||||
msg = towire_struct_open_channel(ctx, &oc);
|
msg = towire_struct_open_channel(ctx, &oc);
|
||||||
@ -1048,6 +1055,7 @@ int main(void)
|
|||||||
set_pubkey(&ac.revocation_basepoint);
|
set_pubkey(&ac.revocation_basepoint);
|
||||||
set_pubkey(&ac.payment_basepoint);
|
set_pubkey(&ac.payment_basepoint);
|
||||||
set_pubkey(&ac.delayed_payment_basepoint);
|
set_pubkey(&ac.delayed_payment_basepoint);
|
||||||
|
set_pubkey(&ac.htlc_basepoint);
|
||||||
set_pubkey(&ac.first_per_commitment_point);
|
set_pubkey(&ac.first_per_commitment_point);
|
||||||
|
|
||||||
msg = towire_struct_accept_channel(ctx, &ac);
|
msg = towire_struct_accept_channel(ctx, &ac);
|
||||||
|
Loading…
Reference in New Issue
Block a user