Documentation
¶
Index ¶
Constants ¶
View Source
const ( MAX_STAGED_HTLCS = 1000 MAX_UNREVOKED_COMMITMENTS = 16 MAX_UPDATED_HTLCS_PER_COMMITMENT = 1000 )
View Source
const ( //HTLC Add ADD_PRESTAGE = 1000 ADD_STAGED = 1100 ADD_SIGNING_AND_REVOKING = 1200 ADD_COMPLETE = 1300 //Most HTLCs should be this ADD_REJECTED = 1999 //Staging request rejected //HTLC Timeout TIMEOUT_PRESTAGE = 2000 TIMEOUT_STAGED = 2100 TIMEOUT_SIGNING_AND_REVOKING = 2200 TIMEOUT_COMPLETE = 2300 //HTLC Settle SETTLE_PRESTAGE = 3000 SETTLE_STAGED = 3100 SETTLE_SIGNING_AND_REVOKING = 3200 SETTLE_COMPLETE = 3300 )
PaymentDescriptor states PRESTAGE: We're not sure if the other guy wants to follow through STAGED: Both parties informally agree to add to their commitments SIGNING_AND_REVOKING: In the process of activating the HTLC
Only one state is allowed at a time. timeout/settle can only begin on an ADD_COMPLETE state. If it times out before it hits completion, channel closes out uncooperatively.
NOTE: Current design assumes if value%1000 == 200 as partially signed/revoked, this means that the code is reliant upon this as knowing when to force close out channels, etc.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LNChannel ¶
type LNChannel struct { sync.RWMutex //HTLCs //Even/odd numbering in effect //Will just take the next number HTLCs map[lnwire.HTLCKey]*PaymentDescriptor // contains filtered or unexported fields }
func (*LNChannel) CreateHTLC ¶
func (l *LNChannel) CreateHTLC(h *PaymentDescriptor) error
Click to show internal directories.
Click to hide internal directories.