mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-25 22:56:56 +02:00
multi: replace NotifyExitHopHtlc eob param with hop.Payload
This commit is contained in:
@@ -233,3 +233,9 @@ func ValidateParsedPayloadTypes(parsedTypes tlv.TypeSet,
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MultiPath returns the record corresponding the option_mpp parsed from the
|
||||
// onion payload.
|
||||
func (h *Payload) MultiPath() *record.MPP {
|
||||
return h.MPP
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ type InvoiceDatabase interface {
|
||||
NotifyExitHopHtlc(payHash lntypes.Hash, paidAmount lnwire.MilliSatoshi,
|
||||
expiry uint32, currentHeight int32,
|
||||
circuitKey channeldb.CircuitKey, hodlChan chan<- interface{},
|
||||
eob []byte) (*invoices.HodlEvent, error)
|
||||
payload invoices.Payload) (*invoices.HodlEvent, error)
|
||||
|
||||
// CancelInvoice attempts to cancel the invoice corresponding to the
|
||||
// passed payment hash.
|
||||
|
@@ -2676,8 +2676,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
switch fwdInfo.NextHop {
|
||||
case hop.Exit:
|
||||
updated, err := l.processExitHop(
|
||||
pd, obfuscator, fwdInfo, heightNow,
|
||||
chanIterator.ExtraOnionBlob(),
|
||||
pd, obfuscator, fwdInfo, heightNow, pld,
|
||||
)
|
||||
if err != nil {
|
||||
l.fail(LinkFailureError{code: ErrInternalError},
|
||||
@@ -2846,7 +2845,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
// returns a boolean indicating whether the commitment tx needs an update.
|
||||
func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
|
||||
obfuscator hop.ErrorEncrypter, fwdInfo hop.ForwardingInfo,
|
||||
heightNow uint32, eob []byte) (bool, error) {
|
||||
heightNow uint32, payload invoices.Payload) (bool, error) {
|
||||
|
||||
// If hodl.ExitSettle is requested, we will not validate the final hop's
|
||||
// ADD, nor will we settle the corresponding invoice or respond with the
|
||||
@@ -2897,7 +2896,7 @@ func (l *channelLink) processExitHop(pd *lnwallet.PaymentDescriptor,
|
||||
|
||||
event, err := l.cfg.Registry.NotifyExitHopHtlc(
|
||||
invoiceHash, pd.Amount, pd.Timeout, int32(heightNow),
|
||||
circuitKey, l.hodlQueue.ChanIn(), eob,
|
||||
circuitKey, l.hodlQueue.ChanIn(), payload,
|
||||
)
|
||||
|
||||
switch err {
|
||||
|
@@ -814,10 +814,11 @@ func (i *mockInvoiceRegistry) SettleHodlInvoice(preimage lntypes.Preimage) error
|
||||
func (i *mockInvoiceRegistry) NotifyExitHopHtlc(rhash lntypes.Hash,
|
||||
amt lnwire.MilliSatoshi, expiry uint32, currentHeight int32,
|
||||
circuitKey channeldb.CircuitKey, hodlChan chan<- interface{},
|
||||
eob []byte) (*invoices.HodlEvent, error) {
|
||||
payload invoices.Payload) (*invoices.HodlEvent, error) {
|
||||
|
||||
event, err := i.registry.NotifyExitHopHtlc(
|
||||
rhash, amt, expiry, currentHeight, circuitKey, hodlChan, eob,
|
||||
rhash, amt, expiry, currentHeight, circuitKey, hodlChan,
|
||||
payload,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user