mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
lnwallet: detect and handle noop HTLCs
We update the lightning channel state machine in some key areas. If the noop TLV is set in the update_add_htlc custom records then we change the entry type to noop. When settling the HTLC if the type is noop we credit the satoshi amount back to the sender.
This commit is contained in:
committed by
Oliver Gugger
parent
c9d8e41e34
commit
776df9159e
@@ -10,9 +10,20 @@ import (
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
)
|
||||
|
||||
// htlcCustomSigType is the TLV type that is used to encode the custom HTLC
|
||||
// signatures within the custom data for an existing HTLC.
|
||||
var htlcCustomSigType tlv.TlvType65543
|
||||
var (
|
||||
// htlcCustomSigType is the TLV type that is used to encode the custom
|
||||
// HTLC signatures within the custom data for an existing HTLC.
|
||||
htlcCustomSigType tlv.TlvType65543
|
||||
|
||||
// NoOpHtlcTLVEntry is the TLV that that's used in the update_add_htlc
|
||||
// message to indicate the presence of a noop HTLC. This has no encoded
|
||||
// value, its presence is used to indicate that the HTLC is a noop.
|
||||
NoOpHtlcTLVEntry tlv.TlvType65544
|
||||
)
|
||||
|
||||
// NoOpHtlcTLVType is the (golang) type of the TLV record that's used to signal
|
||||
// that an HTLC should be a noop HTLC.
|
||||
type NoOpHtlcTLVType = tlv.TlvType65544
|
||||
|
||||
// AuxHtlcView is a struct that contains a safe copy of an HTLC view that can
|
||||
// be used by aux components.
|
||||
|
Reference in New Issue
Block a user