Browse Source

subdaemons: pass back and forth the htlc points.

Openingd sets it to the same as the payment point for the remote side.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
fc05779f78
  1. 3
      channeld/channel.c
  2. 7
      channeld/channel_wire.csv
  3. 8
      lightningd/peer_control.c
  4. 3
      onchaind/onchain.c
  5. 1
      onchaind/onchain_wire.csv
  6. 2
      openingd/opening.c
  7. 2
      openingd/opening_wire.csv

3
channeld/channel.c

@ -2023,6 +2023,7 @@ static void init_channel(struct peer *peer)
&funding_pubkey[REMOTE],
&points[REMOTE].revocation,
&points[REMOTE].payment,
&points[REMOTE].htlc,
&points[REMOTE].delayed_payment,
&peer->remote_per_commit,
&peer->old_remote_per_commit,
@ -2057,8 +2058,6 @@ static void init_channel(struct peer *peer)
&funding_signed))
master_badmsg(WIRE_CHANNEL_INIT, msg);
points[REMOTE].htlc = points[REMOTE].payment;
status_trace("init %s: remote_per_commit = %s, old_remote_per_commit = %s"
" next_idx_local = %"PRIu64
" next_idx_remote = %"PRIu64

7
channeld/channel_wire.csv

@ -16,9 +16,10 @@ channel_init,,feerate_per_kw,u32
channel_init,,first_commit_sig,secp256k1_ecdsa_signature
channel_init,,crypto_state,struct crypto_state
channel_init,,remote_fundingkey,struct pubkey
channel_init,,revocation_basepoint,struct pubkey
channel_init,,payment_basepoint,struct pubkey
channel_init,,delayed_payment_basepoint,struct pubkey
channel_init,,remote_revocation_basepoint,struct pubkey
channel_init,,remote_payment_basepoint,struct pubkey
channel_init,,remote_htlc_basepoint,struct pubkey
channel_init,,remote_delayed_payment_basepoint,struct pubkey
channel_init,,remote_per_commit,struct pubkey
channel_init,,old_remote_per_commit,struct pubkey
channel_init,,funder,enum side

Can't render this file because it has a wrong number of fields in line 2.

8
lightningd/peer_control.c

@ -1408,6 +1408,7 @@ static enum watch_result funding_spent(struct peer *peer,
&ourkey,
peer->funder,
&peer->channel_info->theirbase.payment,
&peer->channel_info->theirbase.htlc,
&peer->channel_info->theirbase.delayed_payment,
tx,
block->height,
@ -2093,6 +2094,7 @@ static bool peer_start_channeld(struct peer *peer,
&peer->channel_info->remote_fundingkey,
&peer->channel_info->theirbase.revocation,
&peer->channel_info->theirbase.payment,
&peer->channel_info->theirbase.htlc,
&peer->channel_info->theirbase.delayed_payment,
&peer->channel_info->remote_per_commit,
&peer->channel_info->old_remote_per_commit,
@ -2167,6 +2169,7 @@ static void opening_funder_finished(struct subd *opening, const u8 *resp,
&cs,
&channel_info->theirbase.revocation,
&channel_info->theirbase.payment,
&channel_info->theirbase.htlc,
&channel_info->theirbase.delayed_payment,
&channel_info->remote_per_commit,
&fc->peer->minimum_depth,
@ -2177,8 +2180,6 @@ static void opening_funder_finished(struct subd *opening, const u8 *resp,
tal_hex(resp, resp));
return;
}
/* FIXME */
channel_info->theirbase.htlc = channel_info->theirbase.payment;
/* old_remote_per_commit not valid yet, copy valid one. */
channel_info->old_remote_per_commit = channel_info->remote_per_commit;
@ -2284,6 +2285,7 @@ static void opening_fundee_finished(struct subd *opening,
&cs,
&channel_info->theirbase.revocation,
&channel_info->theirbase.payment,
&channel_info->theirbase.htlc,
&channel_info->theirbase.delayed_payment,
&channel_info->remote_per_commit,
&channel_info->remote_fundingkey,
@ -2298,8 +2300,6 @@ static void opening_fundee_finished(struct subd *opening,
tal_hex(reply, reply));
return;
}
/* FIXME */
channel_info->theirbase.htlc = channel_info->theirbase.payment;
/* old_remote_per_commit not valid yet, copy valid one. */
channel_info->old_remote_per_commit = channel_info->remote_per_commit;

3
onchaind/onchain.c

@ -1974,6 +1974,7 @@ int main(int argc, char *argv[])
&our_wallet_pubkey,
&funder,
&remote_payment_basepoint,
&remote_htlc_basepoint,
&remote_delayed_payment_basepoint,
tx,
&tx_blockheight,
@ -1982,7 +1983,7 @@ int main(int argc, char *argv[])
&num_htlcs)) {
master_badmsg(WIRE_ONCHAIN_INIT, msg);
}
remote_htlc_basepoint = remote_payment_basepoint;
derive_basepoints(&seed, NULL, &basepoints, &secrets, &shaseed);
bitcoin_txid(tx, &txid);

1
onchaind/onchain_wire.csv

@ -23,6 +23,7 @@ onchain_init,,ourwallet_pubkey,struct pubkey
# We need these two for commit number obscurer
onchain_init,,funder,enum side
onchain_init,,remote_payment_basepoint,struct pubkey
onchain_init,,remote_htlc_basepoint,struct pubkey
onchain_init,,remote_delayed_payment_basepoint,struct pubkey
onchain_init,,tx,struct bitcoin_tx
onchain_init,,tx_blockheight,u32

Can't render this file because it has a wrong number of fields in line 2.

2
openingd/opening.c

@ -443,6 +443,7 @@ static u8 *funder_channel(struct state *state,
&state->cs,
&theirs.revocation,
&theirs.payment,
&theirs.htlc,
&theirs.delayed_payment,
&state->next_per_commit[REMOTE],
minimum_depth,
@ -665,6 +666,7 @@ static u8 *fundee_channel(struct state *state,
&state->cs,
&theirs.revocation,
&theirs.payment,
&theirs.htlc,
&theirs.delayed_payment,
&state->next_per_commit[REMOTE],
&their_funding_pubkey,

2
openingd/opening_wire.csv

@ -36,6 +36,7 @@ opening_funder_reply,,first_commit_sig,secp256k1_ecdsa_signature
opening_funder_reply,,crypto_state,struct crypto_state
opening_funder_reply,,revocation_basepoint,struct pubkey
opening_funder_reply,,payment_basepoint,struct pubkey
opening_funder_reply,,htlc_basepoint,struct pubkey
opening_funder_reply,,delayed_payment_basepoint,struct pubkey
opening_funder_reply,,their_per_commit_point,struct pubkey
opening_funder_reply,,minimum_depth,u32
@ -59,6 +60,7 @@ opening_fundee_reply,,first_commit_sig,secp256k1_ecdsa_signature
opening_fundee_reply,,crypto_state,struct crypto_state
opening_fundee_reply,,revocation_basepoint,struct pubkey
opening_fundee_reply,,payment_basepoint,struct pubkey
opening_fundee_reply,,htlc_basepoint,struct pubkey
opening_fundee_reply,,delayed_payment_basepoint,struct pubkey
opening_fundee_reply,,their_per_commit_point,struct pubkey
opening_fundee_reply,,remote_fundingkey,struct pubkey

Can't render this file because it has a wrong number of fields in line 3.
Loading…
Cancel
Save