Skip to content

Commit

Permalink
lightningd/pay: simplify code significantly.
Browse files Browse the repository at this point in the history
We no longer need a 'sendpay_result' structure, we can pass
appropriate parameter directly now they're simple calls.

Every waitsendpay command ends in tell_waiters_failed or
tell_waiters_success, which call sendpay_success or sendpay_fail on
all matching waiters.  These all return 'struct command_result *'.

In cases where the result is immediately known, we call
sendpay_success/sendpay_fail directly for the command.

This also adds a helpful 'failcodename' field to the JSON output.

[ This was four separate cleanup patches, but that contained much
redundancy and was even worse to review ]

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Jan 23, 2019
1 parent 1c58351 commit 4e6b8e1
Showing 1 changed file with 164 additions and 322 deletions.
Loading

0 comments on commit 4e6b8e1

Please sign in to comment.