mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-07 07:04:25 +01:00
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.
This commit is contained in:
committed by
Rusty Russell
parent
79582ea415
commit
79f848145c
@@ -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;
|
||||
|
||||
@@ -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!
|
||||
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user