Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htlcswitch: settle invoices behind switch [WIP] #2054

Closed

Conversation

joostjager
Copy link
Contributor

@joostjager joostjager commented Oct 15, 2018

This PR is an exploration of what would happen when we move invoice settling behind the switch instead of inside the channel link.

Goals:

  • Leverage CircuitMap to store the link between the final htlc and an invoice (proposal: outgoingchannelid=exithop, outgoinghtlcidx=invoice addindex). This link can be used when hold invoices are settled/failed over rpc.
  • Prepare for amp. With amp, invoices are settled via multiple channel links. Therefore the invoice settling needs to be lifted out of the link level.

Implementation:

  • Remove the complete 'if exithop' case from the link
  • Have the switch match exithop with the outgoing channel id and forward to a new struct InvoiceSettler.
  • InvoiceSettler is managing the interaction with the invoice database.

@joostjager
Copy link
Contributor Author

Main problem atm is when and how to get the invoice addindex as outgoing htlc index in the circuitmap.

@joostjager
Copy link
Contributor Author

This PR is partially woven into #2022, closing.

@joostjager joostjager closed this Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant