Browse Source

sphinx: Passing shared secret of the HTLC up to the master

This is needed so we can create error messages and wrap them on the
way back.
ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
79f848145c
  1. 3
      lightningd/channel/channel.c
  2. 1
      lightningd/channel/channel_wire.csv
  3. 1
      lightningd/htlc_end.h
  4. 3
      lightningd/peer_control.c

3
lightningd/channel/channel.c

@ -651,7 +651,8 @@ static void their_htlc_locked(const struct htlc *htlc, struct peer *peer)
rs->nextcase == ONION_FORWARD,
rs->hop_data.amt_forward,
rs->hop_data.outgoing_cltv,
&rs->hop_data.channel_id);
&rs->hop_data.channel_id,
&ss);
daemon_conn_send(&peer->master, take(msg));
tal_free(tmpctx);
return;

1
lightningd/channel/channel_wire.csv

@ -88,6 +88,7 @@ channel_accepted_htlc,0,forward,bool
channel_accepted_htlc,0,amt_to_forward,u64
channel_accepted_htlc,0,outgoing_cltv_value,u32
channel_accepted_htlc,0,next_channel,struct short_channel_id
channel_accepted_htlc,0,shared_secret,32
# FIXME: Add code to commit current channel state!

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

1
lightningd/htlc_end.h

@ -28,6 +28,7 @@ struct htlc_end {
u32 outgoing_cltv_value;
u32 cltv_expiry;
struct sha256 payment_hash;
struct sha256 shared_secret;
};
static inline const struct htlc_end *keyof_htlc_end(const struct htlc_end *e)

3
lightningd/peer_control.c

@ -1088,7 +1088,8 @@ static int peer_accepted_htlc(struct peer *peer, const u8 *msg)
hend->next_onion, &forward,
&hend->amt_to_forward,
&hend->outgoing_cltv_value,
&hend->next_channel)) {
&hend->next_channel,
&hend->shared_secret)) {
log_broken(peer->log, "bad fromwire_channel_accepted_htlc %s",
tal_hex(peer, msg));
return -1;

Loading…
Cancel
Save