Skip to content

htlcswitch: settle invoices behind switch [WIP]#2054

Closed
joostjager wants to merge 1 commit into
lightningnetwork:masterfrom
joostjager:invoicesettler
Closed

htlcswitch: settle invoices behind switch [WIP]#2054
joostjager wants to merge 1 commit into
lightningnetwork:masterfrom
joostjager:invoicesettler

Conversation

@joostjager
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@joostjager
Copy link
Copy Markdown
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