channeld: get the onionreply back from lightningd for failed htlcs.

Instead of making it ourselves, lightningd does it.  Now we only have
two cases of failed htlcs: completely malformed (BADONION), and with
an already-wrapped onion reply to send.

This makes channeld's job much simpler.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-02-18 10:28:58 +10:30
parent 7ab5c424b6
commit ed839bfda0
14 changed files with 397 additions and 527 deletions

View File

@@ -393,8 +393,7 @@ int main(int argc, char *argv[])
option_static_remotekey,
fee_payer);
if (!channel_force_htlcs(channel, htlcs, hstates, NULL, NULL, NULL, NULL,
0))
if (!channel_force_htlcs(channel, htlcs, hstates, NULL, NULL, NULL, NULL))
errx(1, "Cannot add HTLCs");
u8 *funding_wscript = bitcoin_redeem_2of2(NULL,