Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Circuit ¶
type Circuit [5]*Data
A Circuit is the generic fixed-length path used for most messages.
type Data ¶
type Data struct {
ID nonce.ID
Node *node.Node
Remaining lnwire.MilliSatoshi
Header, Payload *crypto.Keys
Preimage sha256.Hash
Hop byte
}
A Data keeps track of a connection session. It specifically maintains the account of available bandwidth allocation before it needs to be recharged with new credit, and the current state of the encryption.
func NewSessionData ¶
func NewSessionData( id nonce.ID, node *node.Node, rem lnwire.MilliSatoshi, hdr, pld *crypto.Keys, hop byte, ) (s *Data)
NewSessionData creates a new Data, generating cached public key bytes and preimage.
func (*Data) DecSats ¶
DecSats reduces the amount Remaining, if the requested amount would put the total below zero it returns false, signalling that new data allowance needs to be purchased before any further messages can be sent.
Click to show internal directories.
Click to hide internal directories.