multi: add TLV awareness to htlcswitch, pass extra EOB to the invoice registry

In this commit, we update the `HopIterator` to gain awareness of the new
TLV hop payload. The default `HopIterator` will now hide the details of
the TLV from the caller, and return the same `ForwardingInfo` struct in
a uniform manner. We also add a new method: `ExtraOnionBlob` to allow
the caller to obtain the raw EOB (the serialized TLV stream) to pass
around.

Within the link, we'll now pass the EOB information into the invoice
registry. This allows the registry to parse out any additional
information from the EOB that it needs to settle the payment, such as a
preimage shard in the AMP case.
This commit is contained in:
Olaoluwa Osuntokun
2019-07-30 21:52:17 -07:00
parent c78e3aaa9d
commit 23cc8389f2
10 changed files with 233 additions and 33 deletions

View File

@@ -166,7 +166,7 @@ func (h *htlcIncomingContestResolver) Resolve() (ContractResolver, error) {
// identical to HTLC resolution in the link.
event, err := h.Registry.NotifyExitHopHtlc(
h.payHash, h.htlcAmt, h.htlcExpiry, currentHeight,
hodlChan,
hodlChan, nil,
)
switch err {
case channeldb.ErrInvoiceNotFound: