sphinx: Updating daemon to new sphinx implementation

Mainly switching from the old include to the new include and adjusting
the actual size of the onion packet. It also moves `channel.c` to use
`struct hop_data`.

It introduces a dummy next hop in `channel.c` that will be replaced in
the next commit.
This commit is contained in:
Christian Decker
2017-04-28 16:28:53 +02:00
parent b3af8d50a7
commit f24aab1916
10 changed files with 24 additions and 19 deletions

View File

@@ -316,7 +316,7 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
u64 msatoshi,
u32 cltv_expiry,
const struct sha256 *payment_hash,
const u8 routing[1254])
const u8 routing[TOTAL_PACKET_SIZE])
{
const tal_t *tmpctx = tal_tmpctx(channel);
struct htlc *htlc, *old;
@@ -354,9 +354,9 @@ enum channel_add_err channel_add_htlc(struct channel *channel,
* * [4:amount-msat]
* * [4:cltv-expiry]
* * [32:payment-hash]
* * [1254:onion-routing-packet]
* * [1366:onion-routing-packet]
*/
htlc->routing = tal_dup_arr(htlc, u8, routing, 1254, 0);
htlc->routing = tal_dup_arr(htlc, u8, routing, TOTAL_PACKET_SIZE, 0);
/* FIXME: check expiry etc. against config. */
/* FIXME: set deadline */