id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
128,900
lightningnetwork/lnd
lnwire/query_channel_range.go
Encode
func (q *QueryChannelRange) Encode(w io.Writer, pver uint32) error { return WriteElements(w, q.ChainHash[:], q.FirstBlockHeight, q.NumBlocks, ) }
go
func (q *QueryChannelRange) Encode(w io.Writer, pver uint32) error { return WriteElements(w, q.ChainHash[:], q.FirstBlockHeight, q.NumBlocks, ) }
[ "func", "(", "q", "*", "QueryChannelRange", ")", "Encode", "(", "w", "io", ".", "Writer", ",", "pver", "uint32", ")", "error", "{", "return", "WriteElements", "(", "w", ",", "q", ".", "ChainHash", "[", ":", "]", ",", "q", ".", "FirstBlockHeight", ","...
// Encode serializes the target QueryChannelRange into the passed io.Writer // observing the protocol version specified. // // This is part of the lnwire.Message interface.
[ "Encode", "serializes", "the", "target", "QueryChannelRange", "into", "the", "passed", "io", ".", "Writer", "observing", "the", "protocol", "version", "specified", ".", "This", "is", "part", "of", "the", "lnwire", ".", "Message", "interface", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnwire/query_channel_range.go#L54-L60
128,901
lightningnetwork/lnd
netann/channel_update.go
ChannelUpdateSetDisable
func ChannelUpdateSetDisable(disabled bool) ChannelUpdateModifier { return func(update *lnwire.ChannelUpdate) { if disabled { // Set the bit responsible for marking a channel as // disabled. update.ChannelFlags |= lnwire.ChanUpdateDisabled } else { // Clear the bit responsible for marking a channel as ...
go
func ChannelUpdateSetDisable(disabled bool) ChannelUpdateModifier { return func(update *lnwire.ChannelUpdate) { if disabled { // Set the bit responsible for marking a channel as // disabled. update.ChannelFlags |= lnwire.ChanUpdateDisabled } else { // Clear the bit responsible for marking a channel as ...
[ "func", "ChannelUpdateSetDisable", "(", "disabled", "bool", ")", "ChannelUpdateModifier", "{", "return", "func", "(", "update", "*", "lnwire", ".", "ChannelUpdate", ")", "{", "if", "disabled", "{", "// Set the bit responsible for marking a channel as", "// disabled.", "...
// ChannelUpdateSetDisable sets the disabled channel flag if disabled is true, // and clears the bit otherwise.
[ "ChannelUpdateSetDisable", "sets", "the", "disabled", "channel", "flag", "if", "disabled", "is", "true", "and", "clears", "the", "bit", "otherwise", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/netann/channel_update.go#L20-L32
128,902
lightningnetwork/lnd
netann/channel_update.go
ChannelUpdateFromEdge
func ChannelUpdateFromEdge(info *channeldb.ChannelEdgeInfo, policy *channeldb.ChannelEdgePolicy) (*lnwire.ChannelUpdate, error) { update := &lnwire.ChannelUpdate{ ChainHash: info.ChainHash, ShortChannelID: lnwire.NewShortChanIDFromInt(policy.ChannelID), Timestamp: uint32(policy.LastUpdate.Unix()),...
go
func ChannelUpdateFromEdge(info *channeldb.ChannelEdgeInfo, policy *channeldb.ChannelEdgePolicy) (*lnwire.ChannelUpdate, error) { update := &lnwire.ChannelUpdate{ ChainHash: info.ChainHash, ShortChannelID: lnwire.NewShortChanIDFromInt(policy.ChannelID), Timestamp: uint32(policy.LastUpdate.Unix()),...
[ "func", "ChannelUpdateFromEdge", "(", "info", "*", "channeldb", ".", "ChannelEdgeInfo", ",", "policy", "*", "channeldb", ".", "ChannelEdgePolicy", ")", "(", "*", "lnwire", ".", "ChannelUpdate", ",", "error", ")", "{", "update", ":=", "&", "lnwire", ".", "Cha...
// ChannelUpdateFromEdge reconstructs a signed ChannelUpdate from the given edge // info and policy.
[ "ChannelUpdateFromEdge", "reconstructs", "a", "signed", "ChannelUpdate", "from", "the", "given", "edge", "info", "and", "policy", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/netann/channel_update.go#L117-L141
128,903
lightningnetwork/lnd
pilot.go
validateAtplCfg
func validateAtplCfg(cfg *autoPilotConfig) ([]*autopilot.WeightedHeuristic, error) { var ( heuristicsStr string sum float64 heuristics []*autopilot.WeightedHeuristic ) // Create a help text that we can return in case the config is not // correct. for _, a := range autopilot.AvailableHeuristic...
go
func validateAtplCfg(cfg *autoPilotConfig) ([]*autopilot.WeightedHeuristic, error) { var ( heuristicsStr string sum float64 heuristics []*autopilot.WeightedHeuristic ) // Create a help text that we can return in case the config is not // correct. for _, a := range autopilot.AvailableHeuristic...
[ "func", "validateAtplCfg", "(", "cfg", "*", "autoPilotConfig", ")", "(", "[", "]", "*", "autopilot", ".", "WeightedHeuristic", ",", "error", ")", "{", "var", "(", "heuristicsStr", "string", "\n", "sum", "float64", "\n", "heuristics", "[", "]", "*", "autopi...
// validateAtplConfig is a helper method that makes sure the passed // configuration is sane. Currently it checks that the heuristic configuration // makes sense. In case the config is valid, it will return a list of // WeightedHeuristics that can be combined for use with the autopilot agent.
[ "validateAtplConfig", "is", "a", "helper", "method", "that", "makes", "sure", "the", "passed", "configuration", "is", "sane", ".", "Currently", "it", "checks", "that", "the", "heuristic", "configuration", "makes", "sense", ".", "In", "case", "the", "config", "...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/pilot.go#L21-L69
128,904
lightningnetwork/lnd
pilot.go
OpenChannel
func (c *chanController) OpenChannel(target *btcec.PublicKey, amt btcutil.Amount) error { // With the connection established, we'll now establish our connection // to the target peer, waiting for the first update before we exit. feePerKw, err := c.server.cc.feeEstimator.EstimateFeePerKW(3) if err != nil { retur...
go
func (c *chanController) OpenChannel(target *btcec.PublicKey, amt btcutil.Amount) error { // With the connection established, we'll now establish our connection // to the target peer, waiting for the first update before we exit. feePerKw, err := c.server.cc.feeEstimator.EstimateFeePerKW(3) if err != nil { retur...
[ "func", "(", "c", "*", "chanController", ")", "OpenChannel", "(", "target", "*", "btcec", ".", "PublicKey", ",", "amt", "btcutil", ".", "Amount", ")", "error", "{", "// With the connection established, we'll now establish our connection", "// to the target peer, waiting f...
// OpenChannel opens a channel to a target peer, with a capacity of the // specified amount. This function should un-block immediately after the // funding transaction that marks the channel open has been broadcast.
[ "OpenChannel", "opens", "a", "channel", "to", "a", "target", "peer", "with", "a", "capacity", "of", "the", "specified", "amount", ".", "This", "function", "should", "un", "-", "block", "immediately", "after", "the", "funding", "transaction", "that", "marks", ...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/pilot.go#L82-L118
128,905
lightningnetwork/lnd
netann/node_signer.go
NewNodeSigner
func NewNodeSigner(key *btcec.PrivateKey) *NodeSigner { priv := &btcec.PrivateKey{} priv.Curve = btcec.S256() priv.PublicKey.X = key.X priv.PublicKey.Y = key.Y priv.D = key.D return &NodeSigner{ privKey: priv, } }
go
func NewNodeSigner(key *btcec.PrivateKey) *NodeSigner { priv := &btcec.PrivateKey{} priv.Curve = btcec.S256() priv.PublicKey.X = key.X priv.PublicKey.Y = key.Y priv.D = key.D return &NodeSigner{ privKey: priv, } }
[ "func", "NewNodeSigner", "(", "key", "*", "btcec", ".", "PrivateKey", ")", "*", "NodeSigner", "{", "priv", ":=", "&", "btcec", ".", "PrivateKey", "{", "}", "\n", "priv", ".", "Curve", "=", "btcec", ".", "S256", "(", ")", "\n", "priv", ".", "PublicKey...
// NewNodeSigner creates a new instance of the NodeSigner backed by the target // private key.
[ "NewNodeSigner", "creates", "a", "new", "instance", "of", "the", "NodeSigner", "backed", "by", "the", "target", "private", "key", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/netann/node_signer.go#L19-L28
128,906
lightningnetwork/lnd
netann/node_signer.go
SignMessage
func (n *NodeSigner) SignMessage(pubKey *btcec.PublicKey, msg []byte) (*btcec.Signature, error) { // If this isn't our identity public key, then we'll exit early with an // error as we can't sign with this key. if !pubKey.IsEqual(n.privKey.PubKey()) { return nil, fmt.Errorf("unknown public key") } // Otherwis...
go
func (n *NodeSigner) SignMessage(pubKey *btcec.PublicKey, msg []byte) (*btcec.Signature, error) { // If this isn't our identity public key, then we'll exit early with an // error as we can't sign with this key. if !pubKey.IsEqual(n.privKey.PubKey()) { return nil, fmt.Errorf("unknown public key") } // Otherwis...
[ "func", "(", "n", "*", "NodeSigner", ")", "SignMessage", "(", "pubKey", "*", "btcec", ".", "PublicKey", ",", "msg", "[", "]", "byte", ")", "(", "*", "btcec", ".", "Signature", ",", "error", ")", "{", "// If this isn't our identity public key, then we'll exit e...
// SignMessage signs a double-sha256 digest of the passed msg under the // resident node's private key. If the target public key is _not_ the node's // private key, then an error will be returned.
[ "SignMessage", "signs", "a", "double", "-", "sha256", "digest", "of", "the", "passed", "msg", "under", "the", "resident", "node", "s", "private", "key", ".", "If", "the", "target", "public", "key", "is", "_not_", "the", "node", "s", "private", "key", "th...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/netann/node_signer.go#L33-L50
128,907
lightningnetwork/lnd
netann/node_signer.go
SignCompact
func (n *NodeSigner) SignCompact(msg []byte) ([]byte, error) { // We'll sign the dsha256 of the target message. digest := chainhash.DoubleHashB(msg) return n.SignDigestCompact(digest) }
go
func (n *NodeSigner) SignCompact(msg []byte) ([]byte, error) { // We'll sign the dsha256 of the target message. digest := chainhash.DoubleHashB(msg) return n.SignDigestCompact(digest) }
[ "func", "(", "n", "*", "NodeSigner", ")", "SignCompact", "(", "msg", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "// We'll sign the dsha256 of the target message.", "digest", ":=", "chainhash", ".", "DoubleHashB", "(", "msg", ")", ...
// SignCompact signs a double-sha256 digest of the msg parameter under the // resident node's private key. The returned signature is a pubkey-recoverable // signature.
[ "SignCompact", "signs", "a", "double", "-", "sha256", "digest", "of", "the", "msg", "parameter", "under", "the", "resident", "node", "s", "private", "key", ".", "The", "returned", "signature", "is", "a", "pubkey", "-", "recoverable", "signature", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/netann/node_signer.go#L55-L60
128,908
lightningnetwork/lnd
netann/node_signer.go
SignDigestCompact
func (n *NodeSigner) SignDigestCompact(hash []byte) ([]byte, error) { // Should the signature reference a compressed public key or not. isCompressedKey := true // btcec.SignCompact returns a pubkey-recoverable signature sig, err := btcec.SignCompact( btcec.S256(), n.privKey, hash, isCompressedKey, ) if err !=...
go
func (n *NodeSigner) SignDigestCompact(hash []byte) ([]byte, error) { // Should the signature reference a compressed public key or not. isCompressedKey := true // btcec.SignCompact returns a pubkey-recoverable signature sig, err := btcec.SignCompact( btcec.S256(), n.privKey, hash, isCompressedKey, ) if err !=...
[ "func", "(", "n", "*", "NodeSigner", ")", "SignDigestCompact", "(", "hash", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "// Should the signature reference a compressed public key or not.", "isCompressedKey", ":=", "true", "\n\n", "// btce...
// SignDigestCompact signs the provided message digest under the resident // node's private key. The returned signature is a pubkey-recoverable signature.
[ "SignDigestCompact", "signs", "the", "provided", "message", "digest", "under", "the", "resident", "node", "s", "private", "key", ".", "The", "returned", "signature", "is", "a", "pubkey", "-", "recoverable", "signature", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/netann/node_signer.go#L64-L78
128,909
lightningnetwork/lnd
discovery/message_store.go
NewMessageStore
func NewMessageStore(db *channeldb.DB) (*MessageStore, error) { err := db.Update(func(tx *bbolt.Tx) error { _, err := tx.CreateBucketIfNotExists(messageStoreBucket) return err }) if err != nil { return nil, fmt.Errorf("unable to create required buckets: %v", err) } return &MessageStore{db}, nil }
go
func NewMessageStore(db *channeldb.DB) (*MessageStore, error) { err := db.Update(func(tx *bbolt.Tx) error { _, err := tx.CreateBucketIfNotExists(messageStoreBucket) return err }) if err != nil { return nil, fmt.Errorf("unable to create required buckets: %v", err) } return &MessageStore{db}, nil }
[ "func", "NewMessageStore", "(", "db", "*", "channeldb", ".", "DB", ")", "(", "*", "MessageStore", ",", "error", ")", "{", "err", ":=", "db", ".", "Update", "(", "func", "(", "tx", "*", "bbolt", ".", "Tx", ")", "error", "{", "_", ",", "err", ":=",...
// NewMessageStore creates a new message store backed by a channeldb instance.
[ "NewMessageStore", "creates", "a", "new", "message", "store", "backed", "by", "a", "channeldb", "instance", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L70-L81
128,910
lightningnetwork/lnd
discovery/message_store.go
msgShortChanID
func msgShortChanID(msg lnwire.Message) (lnwire.ShortChannelID, error) { var shortChanID lnwire.ShortChannelID switch msg := msg.(type) { case *lnwire.AnnounceSignatures: shortChanID = msg.ShortChannelID case *lnwire.ChannelUpdate: shortChanID = msg.ShortChannelID default: return shortChanID, ErrUnsupportedM...
go
func msgShortChanID(msg lnwire.Message) (lnwire.ShortChannelID, error) { var shortChanID lnwire.ShortChannelID switch msg := msg.(type) { case *lnwire.AnnounceSignatures: shortChanID = msg.ShortChannelID case *lnwire.ChannelUpdate: shortChanID = msg.ShortChannelID default: return shortChanID, ErrUnsupportedM...
[ "func", "msgShortChanID", "(", "msg", "lnwire", ".", "Message", ")", "(", "lnwire", ".", "ShortChannelID", ",", "error", ")", "{", "var", "shortChanID", "lnwire", ".", "ShortChannelID", "\n", "switch", "msg", ":=", "msg", ".", "(", "type", ")", "{", "cas...
// msgShortChanID retrieves the short channel ID of the message.
[ "msgShortChanID", "retrieves", "the", "short", "channel", "ID", "of", "the", "message", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L84-L96
128,911
lightningnetwork/lnd
discovery/message_store.go
messageStoreKey
func messageStoreKey(msg lnwire.Message, peerPubKey [33]byte) ([]byte, error) { shortChanID, err := msgShortChanID(msg) if err != nil { return nil, err } var k [33 + 8 + 2]byte copy(k[:33], peerPubKey[:]) binary.BigEndian.PutUint64(k[33:41], shortChanID.ToUint64()) binary.BigEndian.PutUint16(k[41:43], uint16(...
go
func messageStoreKey(msg lnwire.Message, peerPubKey [33]byte) ([]byte, error) { shortChanID, err := msgShortChanID(msg) if err != nil { return nil, err } var k [33 + 8 + 2]byte copy(k[:33], peerPubKey[:]) binary.BigEndian.PutUint64(k[33:41], shortChanID.ToUint64()) binary.BigEndian.PutUint16(k[41:43], uint16(...
[ "func", "messageStoreKey", "(", "msg", "lnwire", ".", "Message", ",", "peerPubKey", "[", "33", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "shortChanID", ",", "err", ":=", "msgShortChanID", "(", "msg", ")", "\n", "if", "err", "!=...
// messageStoreKey constructs the database key for the message to be stored.
[ "messageStoreKey", "constructs", "the", "database", "key", "for", "the", "message", "to", "be", "stored", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L99-L111
128,912
lightningnetwork/lnd
discovery/message_store.go
AddMessage
func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error { // Construct the key for which we'll find this message with in the store. msgKey, err := messageStoreKey(msg, peerPubKey) if err != nil { return err } // Serialize the message with its wire encoding. var b bytes.Buffer if _, er...
go
func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error { // Construct the key for which we'll find this message with in the store. msgKey, err := messageStoreKey(msg, peerPubKey) if err != nil { return err } // Serialize the message with its wire encoding. var b bytes.Buffer if _, er...
[ "func", "(", "s", "*", "MessageStore", ")", "AddMessage", "(", "msg", "lnwire", ".", "Message", ",", "peerPubKey", "[", "33", "]", "byte", ")", "error", "{", "// Construct the key for which we'll find this message with in the store.", "msgKey", ",", "err", ":=", "...
// AddMessage adds a message to the store for this peer.
[ "AddMessage", "adds", "a", "message", "to", "the", "store", "for", "this", "peer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L114-L135
128,913
lightningnetwork/lnd
discovery/message_store.go
DeleteMessage
func (s *MessageStore) DeleteMessage(msg lnwire.Message, peerPubKey [33]byte) error { // Construct the key for which we'll find this message with in the // store. msgKey, err := messageStoreKey(msg, peerPubKey) if err != nil { return err } return s.db.Batch(func(tx *bbolt.Tx) error { messageStore := tx.Buc...
go
func (s *MessageStore) DeleteMessage(msg lnwire.Message, peerPubKey [33]byte) error { // Construct the key for which we'll find this message with in the // store. msgKey, err := messageStoreKey(msg, peerPubKey) if err != nil { return err } return s.db.Batch(func(tx *bbolt.Tx) error { messageStore := tx.Buc...
[ "func", "(", "s", "*", "MessageStore", ")", "DeleteMessage", "(", "msg", "lnwire", ".", "Message", ",", "peerPubKey", "[", "33", "]", "byte", ")", "error", "{", "// Construct the key for which we'll find this message with in the", "// store.", "msgKey", ",", "err", ...
// DeleteMessage deletes a message from the store for this peer.
[ "DeleteMessage", "deletes", "a", "message", "from", "the", "store", "for", "this", "peer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L138-L180
128,914
lightningnetwork/lnd
discovery/message_store.go
readMessage
func readMessage(msgBytes []byte) (lnwire.Message, error) { msg, err := lnwire.ReadMessage(bytes.NewReader(msgBytes), 0) if err != nil { return nil, err } // Check if the message is supported by the store. We can reuse the // check for ShortChannelID as its a dependency on messages stored. if _, err := msgShor...
go
func readMessage(msgBytes []byte) (lnwire.Message, error) { msg, err := lnwire.ReadMessage(bytes.NewReader(msgBytes), 0) if err != nil { return nil, err } // Check if the message is supported by the store. We can reuse the // check for ShortChannelID as its a dependency on messages stored. if _, err := msgShor...
[ "func", "readMessage", "(", "msgBytes", "[", "]", "byte", ")", "(", "lnwire", ".", "Message", ",", "error", ")", "{", "msg", ",", "err", ":=", "lnwire", ".", "ReadMessage", "(", "bytes", ".", "NewReader", "(", "msgBytes", ")", ",", "0", ")", "\n", ...
// readMessage reads a message from its serialized form and ensures its // supported by the current version of the message store.
[ "readMessage", "reads", "a", "message", "from", "its", "serialized", "form", "and", "ensures", "its", "supported", "by", "the", "current", "version", "of", "the", "message", "store", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L184-L197
128,915
lightningnetwork/lnd
discovery/message_store.go
Messages
func (s *MessageStore) Messages() (map[[33]byte][]lnwire.Message, error) { msgs := make(map[[33]byte][]lnwire.Message) err := s.db.View(func(tx *bbolt.Tx) error { messageStore := tx.Bucket(messageStoreBucket) if messageStore == nil { return ErrCorruptedMessageStore } return messageStore.ForEach(func(k, v ...
go
func (s *MessageStore) Messages() (map[[33]byte][]lnwire.Message, error) { msgs := make(map[[33]byte][]lnwire.Message) err := s.db.View(func(tx *bbolt.Tx) error { messageStore := tx.Bucket(messageStoreBucket) if messageStore == nil { return ErrCorruptedMessageStore } return messageStore.ForEach(func(k, v ...
[ "func", "(", "s", "*", "MessageStore", ")", "Messages", "(", ")", "(", "map", "[", "[", "33", "]", "byte", "]", "[", "]", "lnwire", ".", "Message", ",", "error", ")", "{", "msgs", ":=", "make", "(", "map", "[", "[", "33", "]", "byte", "]", "[...
// Messages returns the total set of messages that exist within the store for // all peers.
[ "Messages", "returns", "the", "total", "set", "of", "messages", "that", "exist", "within", "the", "store", "for", "all", "peers", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L201-L233
128,916
lightningnetwork/lnd
discovery/message_store.go
MessagesForPeer
func (s *MessageStore) MessagesForPeer( peerPubKey [33]byte) ([]lnwire.Message, error) { var msgs []lnwire.Message err := s.db.View(func(tx *bbolt.Tx) error { messageStore := tx.Bucket(messageStoreBucket) if messageStore == nil { return ErrCorruptedMessageStore } c := messageStore.Cursor() k, v := c.S...
go
func (s *MessageStore) MessagesForPeer( peerPubKey [33]byte) ([]lnwire.Message, error) { var msgs []lnwire.Message err := s.db.View(func(tx *bbolt.Tx) error { messageStore := tx.Bucket(messageStoreBucket) if messageStore == nil { return ErrCorruptedMessageStore } c := messageStore.Cursor() k, v := c.S...
[ "func", "(", "s", "*", "MessageStore", ")", "MessagesForPeer", "(", "peerPubKey", "[", "33", "]", "byte", ")", "(", "[", "]", "lnwire", ".", "Message", ",", "error", ")", "{", "var", "msgs", "[", "]", "lnwire", ".", "Message", "\n", "err", ":=", "s...
// MessagesForPeer returns the set of messages that exists within the store for // the given peer.
[ "MessagesForPeer", "returns", "the", "set", "of", "messages", "that", "exists", "within", "the", "store", "for", "the", "given", "peer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L237-L271
128,917
lightningnetwork/lnd
discovery/message_store.go
Peers
func (s *MessageStore) Peers() (map[[33]byte]struct{}, error) { peers := make(map[[33]byte]struct{}) err := s.db.View(func(tx *bbolt.Tx) error { messageStore := tx.Bucket(messageStoreBucket) if messageStore == nil { return ErrCorruptedMessageStore } return messageStore.ForEach(func(k, _ []byte) error { ...
go
func (s *MessageStore) Peers() (map[[33]byte]struct{}, error) { peers := make(map[[33]byte]struct{}) err := s.db.View(func(tx *bbolt.Tx) error { messageStore := tx.Bucket(messageStoreBucket) if messageStore == nil { return ErrCorruptedMessageStore } return messageStore.ForEach(func(k, _ []byte) error { ...
[ "func", "(", "s", "*", "MessageStore", ")", "Peers", "(", ")", "(", "map", "[", "[", "33", "]", "byte", "]", "struct", "{", "}", ",", "error", ")", "{", "peers", ":=", "make", "(", "map", "[", "[", "33", "]", "byte", "]", "struct", "{", "}", ...
// Peers returns the public key of all peers with messages within the store.
[ "Peers", "returns", "the", "public", "key", "of", "all", "peers", "with", "messages", "within", "the", "store", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/discovery/message_store.go#L274-L294
128,918
lightningnetwork/lnd
input/input.go
MakeBaseInput
func MakeBaseInput(outpoint *wire.OutPoint, witnessType WitnessType, signDescriptor *SignDescriptor, heightHint uint32) BaseInput { return BaseInput{ inputKit{ outpoint: *outpoint, witnessType: witnessType, signDesc: *signDescriptor, heightHint: heightHint, }, } }
go
func MakeBaseInput(outpoint *wire.OutPoint, witnessType WitnessType, signDescriptor *SignDescriptor, heightHint uint32) BaseInput { return BaseInput{ inputKit{ outpoint: *outpoint, witnessType: witnessType, signDesc: *signDescriptor, heightHint: heightHint, }, } }
[ "func", "MakeBaseInput", "(", "outpoint", "*", "wire", ".", "OutPoint", ",", "witnessType", "WitnessType", ",", "signDescriptor", "*", "SignDescriptor", ",", "heightHint", "uint32", ")", "BaseInput", "{", "return", "BaseInput", "{", "inputKit", "{", "outpoint", ...
// MakeBaseInput assembles a new BaseInput that can be used to construct a // sweep transaction.
[ "MakeBaseInput", "assembles", "a", "new", "BaseInput", "that", "can", "be", "used", "to", "construct", "a", "sweep", "transaction", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/input/input.go#L85-L96
128,919
lightningnetwork/lnd
input/input.go
MakeHtlcSucceedInput
func MakeHtlcSucceedInput(outpoint *wire.OutPoint, signDescriptor *SignDescriptor, preimage []byte, heightHint uint32) HtlcSucceedInput { return HtlcSucceedInput{ inputKit: inputKit{ outpoint: *outpoint, witnessType: HtlcAcceptedRemoteSuccess, signDesc: *signDescriptor, heightHint: heightHint, ...
go
func MakeHtlcSucceedInput(outpoint *wire.OutPoint, signDescriptor *SignDescriptor, preimage []byte, heightHint uint32) HtlcSucceedInput { return HtlcSucceedInput{ inputKit: inputKit{ outpoint: *outpoint, witnessType: HtlcAcceptedRemoteSuccess, signDesc: *signDescriptor, heightHint: heightHint, ...
[ "func", "MakeHtlcSucceedInput", "(", "outpoint", "*", "wire", ".", "OutPoint", ",", "signDescriptor", "*", "SignDescriptor", ",", "preimage", "[", "]", "byte", ",", "heightHint", "uint32", ")", "HtlcSucceedInput", "{", "return", "HtlcSucceedInput", "{", "inputKit"...
// MakeHtlcSucceedInput assembles a new redeem input that can be used to // construct a sweep transaction.
[ "MakeHtlcSucceedInput", "assembles", "a", "new", "redeem", "input", "that", "can", "be", "used", "to", "construct", "a", "sweep", "transaction", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/input/input.go#L142-L155
128,920
lightningnetwork/lnd
channeldb/channel_cache.go
newChannelCache
func newChannelCache(n int) *channelCache { return &channelCache{ n: n, channels: make(map[uint64]ChannelEdge), } }
go
func newChannelCache(n int) *channelCache { return &channelCache{ n: n, channels: make(map[uint64]ChannelEdge), } }
[ "func", "newChannelCache", "(", "n", "int", ")", "*", "channelCache", "{", "return", "&", "channelCache", "{", "n", ":", "n", ",", "channels", ":", "make", "(", "map", "[", "uint64", "]", "ChannelEdge", ")", ",", "}", "\n", "}" ]
// newChannelCache creates a new channelCache with maximum capacity of n // channels.
[ "newChannelCache", "creates", "a", "new", "channelCache", "with", "maximum", "capacity", "of", "n", "channels", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel_cache.go#L13-L18
128,921
lightningnetwork/lnd
channeldb/channel_cache.go
get
func (c *channelCache) get(chanid uint64) (ChannelEdge, bool) { channel, ok := c.channels[chanid] return channel, ok }
go
func (c *channelCache) get(chanid uint64) (ChannelEdge, bool) { channel, ok := c.channels[chanid] return channel, ok }
[ "func", "(", "c", "*", "channelCache", ")", "get", "(", "chanid", "uint64", ")", "(", "ChannelEdge", ",", "bool", ")", "{", "channel", ",", "ok", ":=", "c", ".", "channels", "[", "chanid", "]", "\n", "return", "channel", ",", "ok", "\n", "}" ]
// get returns the channel from the cache, if it exists.
[ "get", "returns", "the", "channel", "from", "the", "cache", "if", "it", "exists", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel_cache.go#L21-L24
128,922
lightningnetwork/lnd
channeldb/channel_cache.go
insert
func (c *channelCache) insert(chanid uint64, channel ChannelEdge) { // If entry exists, replace it. if _, ok := c.channels[chanid]; ok { c.channels[chanid] = channel return } // Otherwise, evict an entry at random and insert. if len(c.channels) == c.n { for id := range c.channels { delete(c.channels, id)...
go
func (c *channelCache) insert(chanid uint64, channel ChannelEdge) { // If entry exists, replace it. if _, ok := c.channels[chanid]; ok { c.channels[chanid] = channel return } // Otherwise, evict an entry at random and insert. if len(c.channels) == c.n { for id := range c.channels { delete(c.channels, id)...
[ "func", "(", "c", "*", "channelCache", ")", "insert", "(", "chanid", "uint64", ",", "channel", "ChannelEdge", ")", "{", "// If entry exists, replace it.", "if", "_", ",", "ok", ":=", "c", ".", "channels", "[", "chanid", "]", ";", "ok", "{", "c", ".", "...
// insert adds the entry to the channel cache. If an entry for chanid already // exists, it will be replaced with the new entry. If the entry doesn't exist, // it will be inserted to the cache, performing a random eviction if the cache // is at capacity.
[ "insert", "adds", "the", "entry", "to", "the", "channel", "cache", ".", "If", "an", "entry", "for", "chanid", "already", "exists", "it", "will", "be", "replaced", "with", "the", "new", "entry", ".", "If", "the", "entry", "doesn", "t", "exist", "it", "w...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel_cache.go#L30-L45
128,923
lightningnetwork/lnd
cmd/lncli/main.go
extractPathArgs
func extractPathArgs(ctx *cli.Context) (string, string, error) { // We'll start off by parsing the active chain and network. These are // needed to determine the correct path to the macaroon when not // specified. chain := strings.ToLower(ctx.GlobalString("chain")) switch chain { case "bitcoin", "litecoin": defa...
go
func extractPathArgs(ctx *cli.Context) (string, string, error) { // We'll start off by parsing the active chain and network. These are // needed to determine the correct path to the macaroon when not // specified. chain := strings.ToLower(ctx.GlobalString("chain")) switch chain { case "bitcoin", "litecoin": defa...
[ "func", "extractPathArgs", "(", "ctx", "*", "cli", ".", "Context", ")", "(", "string", ",", "string", ",", "error", ")", "{", "// We'll start off by parsing the active chain and network. These are", "// needed to determine the correct path to the macaroon when not", "// specifi...
// extractPathArgs parses the TLS certificate and macaroon paths from the // command.
[ "extractPathArgs", "parses", "the", "TLS", "certificate", "and", "macaroon", "paths", "from", "the", "command", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/cmd/lncli/main.go#L152-L203
128,924
lightningnetwork/lnd
macaroons/service.go
NewService
func NewService(dir string, checks ...Checker) (*Service, error) { // Ensure that the path to the directory exists. if _, err := os.Stat(dir); os.IsNotExist(err) { if err := os.MkdirAll(dir, 0700); err != nil { return nil, err } } // Open the database that we'll use to store the primary macaroon key, // an...
go
func NewService(dir string, checks ...Checker) (*Service, error) { // Ensure that the path to the directory exists. if _, err := os.Stat(dir); os.IsNotExist(err) { if err := os.MkdirAll(dir, 0700); err != nil { return nil, err } } // Open the database that we'll use to store the primary macaroon key, // an...
[ "func", "NewService", "(", "dir", "string", ",", "checks", "...", "Checker", ")", "(", "*", "Service", ",", "error", ")", "{", "// Ensure that the path to the directory exists.", "if", "_", ",", "err", ":=", "os", ".", "Stat", "(", "dir", ")", ";", "os", ...
// NewService returns a service backed by the macaroon Bolt DB stored in the // passed directory. The `checks` argument can be any of the `Checker` type // functions defined in this package, or a custom checker if desired. This // constructor prevents double-registration of checkers to prevent panics, so // listing the...
[ "NewService", "returns", "a", "service", "backed", "by", "the", "macaroon", "Bolt", "DB", "stored", "in", "the", "passed", "directory", ".", "The", "checks", "argument", "can", "be", "any", "of", "the", "Checker", "type", "functions", "defined", "in", "this"...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/macaroons/service.go#L42-L86
128,925
lightningnetwork/lnd
macaroons/service.go
isRegistered
func isRegistered(c *checkers.Checker, name string) bool { if c == nil { return false } for _, info := range c.Info() { if info.Name == name && info.Prefix == "" && info.Namespace == "std" { return true } } return false }
go
func isRegistered(c *checkers.Checker, name string) bool { if c == nil { return false } for _, info := range c.Info() { if info.Name == name && info.Prefix == "" && info.Namespace == "std" { return true } } return false }
[ "func", "isRegistered", "(", "c", "*", "checkers", ".", "Checker", ",", "name", "string", ")", "bool", "{", "if", "c", "==", "nil", "{", "return", "false", "\n", "}", "\n\n", "for", "_", ",", "info", ":=", "range", "c", ".", "Info", "(", ")", "{"...
// isRegistered checks to see if the required checker has already been // registered in order to avoid a panic caused by double registration.
[ "isRegistered", "checks", "to", "see", "if", "the", "required", "checker", "has", "already", "been", "registered", "in", "order", "to", "avoid", "a", "panic", "caused", "by", "double", "registration", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/macaroons/service.go#L90-L104
128,926
lightningnetwork/lnd
macaroons/service.go
UnaryServerInterceptor
func (svc *Service) UnaryServerInterceptor( permissionMap map[string][]bakery.Op) grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { if _, ok := permissionMap[info.FullMethod]; !ok { return nil, fmt.E...
go
func (svc *Service) UnaryServerInterceptor( permissionMap map[string][]bakery.Op) grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { if _, ok := permissionMap[info.FullMethod]; !ok { return nil, fmt.E...
[ "func", "(", "svc", "*", "Service", ")", "UnaryServerInterceptor", "(", "permissionMap", "map", "[", "string", "]", "[", "]", "bakery", ".", "Op", ")", "grpc", ".", "UnaryServerInterceptor", "{", "return", "func", "(", "ctx", "context", ".", "Context", ","...
// UnaryServerInterceptor is a GRPC interceptor that checks whether the // request is authorized by the included macaroons.
[ "UnaryServerInterceptor", "is", "a", "GRPC", "interceptor", "that", "checks", "whether", "the", "request", "is", "authorized", "by", "the", "included", "macaroons", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/macaroons/service.go#L108-L127
128,927
lightningnetwork/lnd
macaroons/service.go
StreamServerInterceptor
func (svc *Service) StreamServerInterceptor( permissionMap map[string][]bakery.Op) grpc.StreamServerInterceptor { return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { if _, ok := permissionMap[info.FullMethod]; !ok { return fmt.Errorf("%s: unknow...
go
func (svc *Service) StreamServerInterceptor( permissionMap map[string][]bakery.Op) grpc.StreamServerInterceptor { return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { if _, ok := permissionMap[info.FullMethod]; !ok { return fmt.Errorf("%s: unknow...
[ "func", "(", "svc", "*", "Service", ")", "StreamServerInterceptor", "(", "permissionMap", "map", "[", "string", "]", "[", "]", "bakery", ".", "Op", ")", "grpc", ".", "StreamServerInterceptor", "{", "return", "func", "(", "srv", "interface", "{", "}", ",", ...
// StreamServerInterceptor is a GRPC interceptor that checks whether the // request is authorized by the included macaroons.
[ "StreamServerInterceptor", "is", "a", "GRPC", "interceptor", "that", "checks", "whether", "the", "request", "is", "authorized", "by", "the", "included", "macaroons", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/macaroons/service.go#L131-L151
128,928
lightningnetwork/lnd
macaroons/service.go
ValidateMacaroon
func (svc *Service) ValidateMacaroon(ctx context.Context, requiredPermissions []bakery.Op) error { // Get macaroon bytes from context and unmarshal into macaroon. md, ok := metadata.FromIncomingContext(ctx) if !ok { return fmt.Errorf("unable to get metadata from context") } if len(md["macaroon"]) != 1 { retu...
go
func (svc *Service) ValidateMacaroon(ctx context.Context, requiredPermissions []bakery.Op) error { // Get macaroon bytes from context and unmarshal into macaroon. md, ok := metadata.FromIncomingContext(ctx) if !ok { return fmt.Errorf("unable to get metadata from context") } if len(md["macaroon"]) != 1 { retu...
[ "func", "(", "svc", "*", "Service", ")", "ValidateMacaroon", "(", "ctx", "context", ".", "Context", ",", "requiredPermissions", "[", "]", "bakery", ".", "Op", ")", "error", "{", "// Get macaroon bytes from context and unmarshal into macaroon.", "md", ",", "ok", ":...
// ValidateMacaroon validates the capabilities of a given request given a // bakery service, context, and uri. Within the passed context.Context, we // expect a macaroon to be encoded as request metadata using the key // "macaroon".
[ "ValidateMacaroon", "validates", "the", "capabilities", "of", "a", "given", "request", "given", "a", "bakery", "service", "context", "and", "uri", ".", "Within", "the", "passed", "context", ".", "Context", "we", "expect", "a", "macaroon", "to", "be", "encoded"...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/macaroons/service.go#L157-L188
128,929
lightningnetwork/lnd
macaroons/service.go
CreateUnlock
func (svc *Service) CreateUnlock(password *[]byte) error { return svc.rks.CreateUnlock(password) }
go
func (svc *Service) CreateUnlock(password *[]byte) error { return svc.rks.CreateUnlock(password) }
[ "func", "(", "svc", "*", "Service", ")", "CreateUnlock", "(", "password", "*", "[", "]", "byte", ")", "error", "{", "return", "svc", ".", "rks", ".", "CreateUnlock", "(", "password", ")", "\n", "}" ]
// CreateUnlock calls the underlying root key store's CreateUnlock and returns // the result.
[ "CreateUnlock", "calls", "the", "underlying", "root", "key", "store", "s", "CreateUnlock", "and", "returns", "the", "result", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/macaroons/service.go#L198-L200
128,930
lightningnetwork/lnd
fundingmanager.go
isLocked
func (r *reservationWithCtx) isLocked() bool { r.updateMtx.RLock() defer r.updateMtx.RUnlock() // The time zero value represents a locked reservation. return r.lastUpdated.IsZero() }
go
func (r *reservationWithCtx) isLocked() bool { r.updateMtx.RLock() defer r.updateMtx.RUnlock() // The time zero value represents a locked reservation. return r.lastUpdated.IsZero() }
[ "func", "(", "r", "*", "reservationWithCtx", ")", "isLocked", "(", ")", "bool", "{", "r", ".", "updateMtx", ".", "RLock", "(", ")", "\n", "defer", "r", ".", "updateMtx", ".", "RUnlock", "(", ")", "\n\n", "// The time zero value represents a locked reservation....
// isLocked checks the reservation's timestamp to determine whether it is locked.
[ "isLocked", "checks", "the", "reservation", "s", "timestamp", "to", "determine", "whether", "it", "is", "locked", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L119-L125
128,931
lightningnetwork/lnd
fundingmanager.go
lock
func (r *reservationWithCtx) lock() { r.updateMtx.Lock() defer r.updateMtx.Unlock() r.lastUpdated = time.Time{} }
go
func (r *reservationWithCtx) lock() { r.updateMtx.Lock() defer r.updateMtx.Unlock() r.lastUpdated = time.Time{} }
[ "func", "(", "r", "*", "reservationWithCtx", ")", "lock", "(", ")", "{", "r", ".", "updateMtx", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "updateMtx", ".", "Unlock", "(", ")", "\n\n", "r", ".", "lastUpdated", "=", "time", ".", "Time", "{", ...
// lock locks the reservation from zombie pruning by setting its timestamp to the // zero value.
[ "lock", "locks", "the", "reservation", "from", "zombie", "pruning", "by", "setting", "its", "timestamp", "to", "the", "zero", "value", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L129-L134
128,932
lightningnetwork/lnd
fundingmanager.go
updateTimestamp
func (r *reservationWithCtx) updateTimestamp() { r.updateMtx.Lock() defer r.updateMtx.Unlock() r.lastUpdated = time.Now() }
go
func (r *reservationWithCtx) updateTimestamp() { r.updateMtx.Lock() defer r.updateMtx.Unlock() r.lastUpdated = time.Now() }
[ "func", "(", "r", "*", "reservationWithCtx", ")", "updateTimestamp", "(", ")", "{", "r", ".", "updateMtx", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "updateMtx", ".", "Unlock", "(", ")", "\n\n", "r", ".", "lastUpdated", "=", "time", ".", "Now",...
// updateTimestamp updates the reservation's timestamp with the current time.
[ "updateTimestamp", "updates", "the", "reservation", "s", "timestamp", "with", "the", "current", "time", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L137-L142
128,933
lightningnetwork/lnd
fundingmanager.go
newSerializedKey
func newSerializedKey(pubKey *btcec.PublicKey) serializedPubKey { var s serializedPubKey copy(s[:], pubKey.SerializeCompressed()) return s }
go
func newSerializedKey(pubKey *btcec.PublicKey) serializedPubKey { var s serializedPubKey copy(s[:], pubKey.SerializeCompressed()) return s }
[ "func", "newSerializedKey", "(", "pubKey", "*", "btcec", ".", "PublicKey", ")", "serializedPubKey", "{", "var", "s", "serializedPubKey", "\n", "copy", "(", "s", "[", ":", "]", ",", "pubKey", ".", "SerializeCompressed", "(", ")", ")", "\n", "return", "s", ...
// newSerializedKey creates a new serialized public key from an instance of a // live pubkey object.
[ "newSerializedKey", "creates", "a", "new", "serialized", "public", "key", "from", "an", "instance", "of", "a", "live", "pubkey", "object", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L213-L217
128,934
lightningnetwork/lnd
fundingmanager.go
newFundingManager
func newFundingManager(cfg fundingConfig) (*fundingManager, error) { return &fundingManager{ cfg: &cfg, chanIDKey: cfg.TempChanIDSeed, activeReservations: make(map[serializedPubKey]pendingChannels), signedReservations: make(map[lnwire.ChannelID][32]by...
go
func newFundingManager(cfg fundingConfig) (*fundingManager, error) { return &fundingManager{ cfg: &cfg, chanIDKey: cfg.TempChanIDSeed, activeReservations: make(map[serializedPubKey]pendingChannels), signedReservations: make(map[lnwire.ChannelID][32]by...
[ "func", "newFundingManager", "(", "cfg", "fundingConfig", ")", "(", "*", "fundingManager", ",", "error", ")", "{", "return", "&", "fundingManager", "{", "cfg", ":", "&", "cfg", ",", "chanIDKey", ":", "cfg", ".", "TempChanIDSeed", ",", "activeReservations", "...
// newFundingManager creates and initializes a new instance of the // fundingManager.
[ "newFundingManager", "creates", "and", "initializes", "a", "new", "instance", "of", "the", "fundingManager", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L455-L469
128,935
lightningnetwork/lnd
fundingmanager.go
Stop
func (f *fundingManager) Stop() error { if atomic.AddInt32(&f.stopped, 1) != 1 { return nil } fndgLog.Infof("Funding manager shutting down") close(f.quit) f.wg.Wait() return nil }
go
func (f *fundingManager) Stop() error { if atomic.AddInt32(&f.stopped, 1) != 1 { return nil } fndgLog.Infof("Funding manager shutting down") close(f.quit) f.wg.Wait() return nil }
[ "func", "(", "f", "*", "fundingManager", ")", "Stop", "(", ")", "error", "{", "if", "atomic", ".", "AddInt32", "(", "&", "f", ".", "stopped", ",", "1", ")", "!=", "1", "{", "return", "nil", "\n", "}", "\n\n", "fndgLog", ".", "Infof", "(", "\"", ...
// Stop signals all helper goroutines to execute a graceful shutdown. This // method will block until all goroutines have exited.
[ "Stop", "signals", "all", "helper", "goroutines", "to", "execute", "a", "graceful", "shutdown", ".", "This", "method", "will", "block", "until", "all", "goroutines", "have", "exited", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L712-L723
128,936
lightningnetwork/lnd
fundingmanager.go
nextPendingChanID
func (f *fundingManager) nextPendingChanID() [32]byte { // Obtain a fresh nonce. We do this by encoding the current nonce // counter, then incrementing it by one. f.nonceMtx.Lock() var nonce [8]byte binary.LittleEndian.PutUint64(nonce[:], f.chanIDNonce) f.chanIDNonce++ f.nonceMtx.Unlock() // We'll generate the...
go
func (f *fundingManager) nextPendingChanID() [32]byte { // Obtain a fresh nonce. We do this by encoding the current nonce // counter, then incrementing it by one. f.nonceMtx.Lock() var nonce [8]byte binary.LittleEndian.PutUint64(nonce[:], f.chanIDNonce) f.chanIDNonce++ f.nonceMtx.Unlock() // We'll generate the...
[ "func", "(", "f", "*", "fundingManager", ")", "nextPendingChanID", "(", ")", "[", "32", "]", "byte", "{", "// Obtain a fresh nonce. We do this by encoding the current nonce", "// counter, then incrementing it by one.", "f", ".", "nonceMtx", ".", "Lock", "(", ")", "\n", ...
// nextPendingChanID returns the next free pending channel ID to be used to // identify a particular future channel funding workflow.
[ "nextPendingChanID", "returns", "the", "next", "free", "pending", "channel", "ID", "to", "be", "used", "to", "identify", "a", "particular", "future", "channel", "funding", "workflow", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L727-L745
128,937
lightningnetwork/lnd
fundingmanager.go
PendingChannels
func (f *fundingManager) PendingChannels() ([]*pendingChannel, error) { respChan := make(chan []*pendingChannel, 1) errChan := make(chan error, 1) req := &pendingChansReq{ resp: respChan, err: errChan, } select { case f.queries <- req: case <-f.quit: return nil, ErrFundingManagerShuttingDown } select...
go
func (f *fundingManager) PendingChannels() ([]*pendingChannel, error) { respChan := make(chan []*pendingChannel, 1) errChan := make(chan error, 1) req := &pendingChansReq{ resp: respChan, err: errChan, } select { case f.queries <- req: case <-f.quit: return nil, ErrFundingManagerShuttingDown } select...
[ "func", "(", "f", "*", "fundingManager", ")", "PendingChannels", "(", ")", "(", "[", "]", "*", "pendingChannel", ",", "error", ")", "{", "respChan", ":=", "make", "(", "chan", "[", "]", "*", "pendingChannel", ",", "1", ")", "\n", "errChan", ":=", "ma...
// PendingChannels returns a slice describing all the channels which are // currently pending at the last state of the funding workflow.
[ "PendingChannels", "returns", "a", "slice", "describing", "all", "the", "channels", "which", "are", "currently", "pending", "at", "the", "last", "state", "of", "the", "funding", "workflow", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L762-L785
128,938
lightningnetwork/lnd
fundingmanager.go
processFundingOpen
func (f *fundingManager) processFundingOpen(msg *lnwire.OpenChannel, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingOpenMsg{msg, peer}: case <-f.quit: return } }
go
func (f *fundingManager) processFundingOpen(msg *lnwire.OpenChannel, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingOpenMsg{msg, peer}: case <-f.quit: return } }
[ "func", "(", "f", "*", "fundingManager", ")", "processFundingOpen", "(", "msg", "*", "lnwire", ".", "OpenChannel", ",", "peer", "lnpeer", ".", "Peer", ")", "{", "select", "{", "case", "f", ".", "fundingMsgs", "<-", "&", "fundingOpenMsg", "{", "msg", ",",...
// processFundingOpen sends a message to the fundingManager allowing it to // initiate the new funding workflow with the source peer.
[ "processFundingOpen", "sends", "a", "message", "to", "the", "fundingManager", "allowing", "it", "to", "initiate", "the", "new", "funding", "workflow", "with", "the", "source", "peer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L952-L960
128,939
lightningnetwork/lnd
fundingmanager.go
processFundingAccept
func (f *fundingManager) processFundingAccept(msg *lnwire.AcceptChannel, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingAcceptMsg{msg, peer}: case <-f.quit: return } }
go
func (f *fundingManager) processFundingAccept(msg *lnwire.AcceptChannel, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingAcceptMsg{msg, peer}: case <-f.quit: return } }
[ "func", "(", "f", "*", "fundingManager", ")", "processFundingAccept", "(", "msg", "*", "lnwire", ".", "AcceptChannel", ",", "peer", "lnpeer", ".", "Peer", ")", "{", "select", "{", "case", "f", ".", "fundingMsgs", "<-", "&", "fundingAcceptMsg", "{", "msg", ...
// processFundingAccept sends a message to the fundingManager allowing it to // continue the second phase of a funding workflow with the target peer.
[ "processFundingAccept", "sends", "a", "message", "to", "the", "fundingManager", "allowing", "it", "to", "continue", "the", "second", "phase", "of", "a", "funding", "workflow", "with", "the", "target", "peer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L1212-L1220
128,940
lightningnetwork/lnd
fundingmanager.go
processFundingCreated
func (f *fundingManager) processFundingCreated(msg *lnwire.FundingCreated, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingCreatedMsg{msg, peer}: case <-f.quit: return } }
go
func (f *fundingManager) processFundingCreated(msg *lnwire.FundingCreated, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingCreatedMsg{msg, peer}: case <-f.quit: return } }
[ "func", "(", "f", "*", "fundingManager", ")", "processFundingCreated", "(", "msg", "*", "lnwire", ".", "FundingCreated", ",", "peer", "lnpeer", ".", "Peer", ")", "{", "select", "{", "case", "f", ".", "fundingMsgs", "<-", "&", "fundingCreatedMsg", "{", "msg...
// processFundingCreated queues a funding complete message coupled with the // source peer to the fundingManager.
[ "processFundingCreated", "queues", "a", "funding", "complete", "message", "coupled", "with", "the", "source", "peer", "to", "the", "fundingManager", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L1371-L1379
128,941
lightningnetwork/lnd
fundingmanager.go
processFundingSigned
func (f *fundingManager) processFundingSigned(msg *lnwire.FundingSigned, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingSignedMsg{msg, peer}: case <-f.quit: return } }
go
func (f *fundingManager) processFundingSigned(msg *lnwire.FundingSigned, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingSignedMsg{msg, peer}: case <-f.quit: return } }
[ "func", "(", "f", "*", "fundingManager", ")", "processFundingSigned", "(", "msg", "*", "lnwire", ".", "FundingSigned", ",", "peer", "lnpeer", ".", "Peer", ")", "{", "select", "{", "case", "f", ".", "fundingMsgs", "<-", "&", "fundingSignedMsg", "{", "msg", ...
// processFundingSigned sends a single funding sign complete message along with // the source peer to the funding manager.
[ "processFundingSigned", "sends", "a", "single", "funding", "sign", "complete", "message", "along", "with", "the", "source", "peer", "to", "the", "funding", "manager", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L1560-L1568
128,942
lightningnetwork/lnd
fundingmanager.go
makeFundingScript
func makeFundingScript(channel *channeldb.OpenChannel) ([]byte, error) { localKey := channel.LocalChanCfg.MultiSigKey.PubKey.SerializeCompressed() remoteKey := channel.RemoteChanCfg.MultiSigKey.PubKey.SerializeCompressed() multiSigScript, err := input.GenMultiSigScript(localKey, remoteKey) if err != nil { return...
go
func makeFundingScript(channel *channeldb.OpenChannel) ([]byte, error) { localKey := channel.LocalChanCfg.MultiSigKey.PubKey.SerializeCompressed() remoteKey := channel.RemoteChanCfg.MultiSigKey.PubKey.SerializeCompressed() multiSigScript, err := input.GenMultiSigScript(localKey, remoteKey) if err != nil { return...
[ "func", "makeFundingScript", "(", "channel", "*", "channeldb", ".", "OpenChannel", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "localKey", ":=", "channel", ".", "LocalChanCfg", ".", "MultiSigKey", ".", "PubKey", ".", "SerializeCompressed", "(", ")", ...
// makeFundingScript re-creates the funding script for the funding transaction // of the target channel.
[ "makeFundingScript", "re", "-", "creates", "the", "funding", "script", "for", "the", "funding", "transaction", "of", "the", "target", "channel", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L1855-L1865
128,943
lightningnetwork/lnd
fundingmanager.go
handleFundingConfirmation
func (f *fundingManager) handleFundingConfirmation(peer lnpeer.Peer, completeChan *channeldb.OpenChannel, shortChanID *lnwire.ShortChannelID) error { // We create the state-machine object which wraps the database state. lnChannel, err := lnwallet.NewLightningChannel( nil, nil, completeChan, nil, ) if err != ni...
go
func (f *fundingManager) handleFundingConfirmation(peer lnpeer.Peer, completeChan *channeldb.OpenChannel, shortChanID *lnwire.ShortChannelID) error { // We create the state-machine object which wraps the database state. lnChannel, err := lnwallet.NewLightningChannel( nil, nil, completeChan, nil, ) if err != ni...
[ "func", "(", "f", "*", "fundingManager", ")", "handleFundingConfirmation", "(", "peer", "lnpeer", ".", "Peer", ",", "completeChan", "*", "channeldb", ".", "OpenChannel", ",", "shortChanID", "*", "lnwire", ".", "ShortChannelID", ")", "error", "{", "// We create t...
// handleFundingConfirmation is a wrapper method for creating a new // lnwallet.LightningChannel object, calling sendFundingLocked, // addToRouterGraph, and annAfterSixConfs. This is called after the funding // transaction is confirmed.
[ "handleFundingConfirmation", "is", "a", "wrapper", "method", "for", "creating", "a", "new", "lnwallet", ".", "LightningChannel", "object", "calling", "sendFundingLocked", "addToRouterGraph", "and", "annAfterSixConfs", ".", "This", "is", "called", "after", "the", "fund...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2002-L2033
128,944
lightningnetwork/lnd
fundingmanager.go
sendFundingLocked
func (f *fundingManager) sendFundingLocked(peer lnpeer.Peer, completeChan *channeldb.OpenChannel, channel *lnwallet.LightningChannel, shortChanID *lnwire.ShortChannelID) error { chanID := lnwire.NewChanIDFromOutPoint(&completeChan.FundingOutpoint) peerKey := completeChan.IdentityPub // Next, we'll send over the ...
go
func (f *fundingManager) sendFundingLocked(peer lnpeer.Peer, completeChan *channeldb.OpenChannel, channel *lnwallet.LightningChannel, shortChanID *lnwire.ShortChannelID) error { chanID := lnwire.NewChanIDFromOutPoint(&completeChan.FundingOutpoint) peerKey := completeChan.IdentityPub // Next, we'll send over the ...
[ "func", "(", "f", "*", "fundingManager", ")", "sendFundingLocked", "(", "peer", "lnpeer", ".", "Peer", ",", "completeChan", "*", "channeldb", ".", "OpenChannel", ",", "channel", "*", "lnwallet", ".", "LightningChannel", ",", "shortChanID", "*", "lnwire", ".", ...
// sendFundingLocked creates and sends the fundingLocked message. // This should be called after the funding transaction has been confirmed, // and the channelState is 'markedOpen'.
[ "sendFundingLocked", "creates", "and", "sends", "the", "fundingLocked", "message", ".", "This", "should", "be", "called", "after", "the", "funding", "transaction", "has", "been", "confirmed", "and", "the", "channelState", "is", "markedOpen", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2038-L2107
128,945
lightningnetwork/lnd
fundingmanager.go
addToRouterGraph
func (f *fundingManager) addToRouterGraph(completeChan *channeldb.OpenChannel, shortChanID *lnwire.ShortChannelID) error { chanID := lnwire.NewChanIDFromOutPoint(&completeChan.FundingOutpoint) // We'll obtain the min HTLC value we can forward in our direction, as // we'll use this value within our ChannelUpdate. ...
go
func (f *fundingManager) addToRouterGraph(completeChan *channeldb.OpenChannel, shortChanID *lnwire.ShortChannelID) error { chanID := lnwire.NewChanIDFromOutPoint(&completeChan.FundingOutpoint) // We'll obtain the min HTLC value we can forward in our direction, as // we'll use this value within our ChannelUpdate. ...
[ "func", "(", "f", "*", "fundingManager", ")", "addToRouterGraph", "(", "completeChan", "*", "channeldb", ".", "OpenChannel", ",", "shortChanID", "*", "lnwire", ".", "ShortChannelID", ")", "error", "{", "chanID", ":=", "lnwire", ".", "NewChanIDFromOutPoint", "(",...
// addToRouterGraph sends a ChannelAnnouncement and a ChannelUpdate to the // gossiper so that the channel is added to the Router's internal graph. // These announcement messages are NOT broadcasted to the greater network, // only to the channel counter party. The proofs required to announce the // channel to the great...
[ "addToRouterGraph", "sends", "a", "ChannelAnnouncement", "and", "a", "ChannelUpdate", "to", "the", "gossiper", "so", "that", "the", "channel", "is", "added", "to", "the", "Router", "s", "internal", "graph", ".", "These", "announcement", "messages", "are", "NOT",...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2114-L2196
128,946
lightningnetwork/lnd
fundingmanager.go
processFundingLocked
func (f *fundingManager) processFundingLocked(msg *lnwire.FundingLocked, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingLockedMsg{msg, peer}: case <-f.quit: return } }
go
func (f *fundingManager) processFundingLocked(msg *lnwire.FundingLocked, peer lnpeer.Peer) { select { case f.fundingMsgs <- &fundingLockedMsg{msg, peer}: case <-f.quit: return } }
[ "func", "(", "f", "*", "fundingManager", ")", "processFundingLocked", "(", "msg", "*", "lnwire", ".", "FundingLocked", ",", "peer", "lnpeer", ".", "Peer", ")", "{", "select", "{", "case", "f", ".", "fundingMsgs", "<-", "&", "fundingLockedMsg", "{", "msg", ...
// processFundingLocked sends a message to the fundingManager allowing it to // finish the funding workflow.
[ "processFundingLocked", "sends", "a", "message", "to", "the", "fundingManager", "allowing", "it", "to", "finish", "the", "funding", "workflow", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2346-L2354
128,947
lightningnetwork/lnd
fundingmanager.go
handleFundingLocked
func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) { defer f.wg.Done() fndgLog.Debugf("Received FundingLocked for ChannelID(%v) from "+ "peer %x", fmsg.msg.ChanID, fmsg.peer.IdentityKey().SerializeCompressed()) // If we are currently in the process of handling a funding locked // message for ...
go
func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) { defer f.wg.Done() fndgLog.Debugf("Received FundingLocked for ChannelID(%v) from "+ "peer %x", fmsg.msg.ChanID, fmsg.peer.IdentityKey().SerializeCompressed()) // If we are currently in the process of handling a funding locked // message for ...
[ "func", "(", "f", "*", "fundingManager", ")", "handleFundingLocked", "(", "fmsg", "*", "fundingLockedMsg", ")", "{", "defer", "f", ".", "wg", ".", "Done", "(", ")", "\n", "fndgLog", ".", "Debugf", "(", "\"", "\"", "+", "\"", "\"", ",", "fmsg", ".", ...
// handleFundingLocked finalizes the channel funding process and enables the // channel to enter normal operating mode.
[ "handleFundingLocked", "finalizes", "the", "channel", "funding", "process", "and", "enables", "the", "channel", "to", "enter", "normal", "operating", "mode", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2358-L2461
128,948
lightningnetwork/lnd
fundingmanager.go
announceChannel
func (f *fundingManager) announceChannel(localIDKey, remoteIDKey, localFundingKey, remoteFundingKey *btcec.PublicKey, shortChanID lnwire.ShortChannelID, chanID lnwire.ChannelID, fwdMinHTLC, fwdMaxHTLC lnwire.MilliSatoshi) error { // First, we'll create the batch of announcements to be sent upon // initial channel ...
go
func (f *fundingManager) announceChannel(localIDKey, remoteIDKey, localFundingKey, remoteFundingKey *btcec.PublicKey, shortChanID lnwire.ShortChannelID, chanID lnwire.ChannelID, fwdMinHTLC, fwdMaxHTLC lnwire.MilliSatoshi) error { // First, we'll create the batch of announcements to be sent upon // initial channel ...
[ "func", "(", "f", "*", "fundingManager", ")", "announceChannel", "(", "localIDKey", ",", "remoteIDKey", ",", "localFundingKey", ",", "remoteFundingKey", "*", "btcec", ".", "PublicKey", ",", "shortChanID", "lnwire", ".", "ShortChannelID", ",", "chanID", "lnwire", ...
// announceChannel announces a newly created channel to the rest of the network // by crafting the two authenticated announcements required for the peers on // the network to recognize the legitimacy of the channel. The crafted // announcements are then sent to the channel router to handle broadcasting to // the networ...
[ "announceChannel", "announces", "a", "newly", "created", "channel", "to", "the", "rest", "of", "the", "network", "by", "crafting", "the", "two", "authenticated", "announcements", "required", "for", "the", "peers", "on", "the", "network", "to", "recognize", "the"...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2629-L2699
128,949
lightningnetwork/lnd
fundingmanager.go
waitUntilChannelOpen
func (f *fundingManager) waitUntilChannelOpen(targetChan lnwire.ChannelID, quit <-chan struct{}) error { f.barrierMtx.RLock() barrier, ok := f.newChanBarriers[targetChan] f.barrierMtx.RUnlock() if ok { fndgLog.Tracef("waiting for chan barrier signal for ChanID(%v)", targetChan) select { case <-barrier: ...
go
func (f *fundingManager) waitUntilChannelOpen(targetChan lnwire.ChannelID, quit <-chan struct{}) error { f.barrierMtx.RLock() barrier, ok := f.newChanBarriers[targetChan] f.barrierMtx.RUnlock() if ok { fndgLog.Tracef("waiting for chan barrier signal for ChanID(%v)", targetChan) select { case <-barrier: ...
[ "func", "(", "f", "*", "fundingManager", ")", "waitUntilChannelOpen", "(", "targetChan", "lnwire", ".", "ChannelID", ",", "quit", "<-", "chan", "struct", "{", "}", ")", "error", "{", "f", ".", "barrierMtx", ".", "RLock", "(", ")", "\n", "barrier", ",", ...
// waitUntilChannelOpen is designed to prevent other lnd subsystems from // sending new update messages to a channel before the channel is fully // opened.
[ "waitUntilChannelOpen", "is", "designed", "to", "prevent", "other", "lnd", "subsystems", "from", "sending", "new", "update", "messages", "to", "a", "channel", "before", "the", "channel", "is", "fully", "opened", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2874-L2897
128,950
lightningnetwork/lnd
fundingmanager.go
processFundingError
func (f *fundingManager) processFundingError(err *lnwire.Error, peerKey *btcec.PublicKey) { select { case f.fundingMsgs <- &fundingErrorMsg{err, peerKey}: case <-f.quit: return } }
go
func (f *fundingManager) processFundingError(err *lnwire.Error, peerKey *btcec.PublicKey) { select { case f.fundingMsgs <- &fundingErrorMsg{err, peerKey}: case <-f.quit: return } }
[ "func", "(", "f", "*", "fundingManager", ")", "processFundingError", "(", "err", "*", "lnwire", ".", "Error", ",", "peerKey", "*", "btcec", ".", "PublicKey", ")", "{", "select", "{", "case", "f", ".", "fundingMsgs", "<-", "&", "fundingErrorMsg", "{", "er...
// processFundingError sends a message to the fundingManager allowing it to // process the occurred generic error.
[ "processFundingError", "sends", "a", "message", "to", "the", "fundingManager", "allowing", "it", "to", "process", "the", "occurred", "generic", "error", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2901-L2909
128,951
lightningnetwork/lnd
fundingmanager.go
handleErrorMsg
func (f *fundingManager) handleErrorMsg(fmsg *fundingErrorMsg) { protocolErr := fmsg.err chanID := fmsg.err.ChanID // First, we'll attempt to retrieve and cancel the funding workflow // that this error was tied to. If we're unable to do so, then we'll // exit early as this was an unwarranted error. resCtx, err ...
go
func (f *fundingManager) handleErrorMsg(fmsg *fundingErrorMsg) { protocolErr := fmsg.err chanID := fmsg.err.ChanID // First, we'll attempt to retrieve and cancel the funding workflow // that this error was tied to. If we're unable to do so, then we'll // exit early as this was an unwarranted error. resCtx, err ...
[ "func", "(", "f", "*", "fundingManager", ")", "handleErrorMsg", "(", "fmsg", "*", "fundingErrorMsg", ")", "{", "protocolErr", ":=", "fmsg", ".", "err", "\n\n", "chanID", ":=", "fmsg", ".", "err", ".", "ChanID", "\n\n", "// First, we'll attempt to retrieve and ca...
// handleErrorMsg processes the error which was received from remote peer, // depending on the type of error we should do different clean up steps and // inform the user about it.
[ "handleErrorMsg", "processes", "the", "error", "which", "was", "received", "from", "remote", "peer", "depending", "on", "the", "type", "of", "error", "we", "should", "do", "different", "clean", "up", "steps", "and", "inform", "the", "user", "about", "it", "....
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2914-L2950
128,952
lightningnetwork/lnd
fundingmanager.go
pruneZombieReservations
func (f *fundingManager) pruneZombieReservations() { zombieReservations := make(pendingChannels) f.resMtx.RLock() for _, pendingReservations := range f.activeReservations { for pendingChanID, resCtx := range pendingReservations { if resCtx.isLocked() { continue } if time.Since(resCtx.lastUpdated) > ...
go
func (f *fundingManager) pruneZombieReservations() { zombieReservations := make(pendingChannels) f.resMtx.RLock() for _, pendingReservations := range f.activeReservations { for pendingChanID, resCtx := range pendingReservations { if resCtx.isLocked() { continue } if time.Since(resCtx.lastUpdated) > ...
[ "func", "(", "f", "*", "fundingManager", ")", "pruneZombieReservations", "(", ")", "{", "zombieReservations", ":=", "make", "(", "pendingChannels", ")", "\n\n", "f", ".", "resMtx", ".", "RLock", "(", ")", "\n", "for", "_", ",", "pendingReservations", ":=", ...
// pruneZombieReservations loops through all pending reservations and fails the // funding flow for any reservations that have not been updated since the // ReservationTimeout and are not locked waiting for the funding transaction.
[ "pruneZombieReservations", "loops", "through", "all", "pending", "reservations", "and", "fails", "the", "funding", "flow", "for", "any", "reservations", "that", "have", "not", "been", "updated", "since", "the", "ReservationTimeout", "and", "are", "not", "locked", ...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2955-L2979
128,953
lightningnetwork/lnd
fundingmanager.go
cancelReservationCtx
func (f *fundingManager) cancelReservationCtx(peerKey *btcec.PublicKey, pendingChanID [32]byte) (*reservationWithCtx, error) { fndgLog.Infof("Cancelling funding reservation for node_key=%x, "+ "chan_id=%x", peerKey.SerializeCompressed(), pendingChanID[:]) peerIDKey := newSerializedKey(peerKey) f.resMtx.Lock() ...
go
func (f *fundingManager) cancelReservationCtx(peerKey *btcec.PublicKey, pendingChanID [32]byte) (*reservationWithCtx, error) { fndgLog.Infof("Cancelling funding reservation for node_key=%x, "+ "chan_id=%x", peerKey.SerializeCompressed(), pendingChanID[:]) peerIDKey := newSerializedKey(peerKey) f.resMtx.Lock() ...
[ "func", "(", "f", "*", "fundingManager", ")", "cancelReservationCtx", "(", "peerKey", "*", "btcec", ".", "PublicKey", ",", "pendingChanID", "[", "32", "]", "byte", ")", "(", "*", "reservationWithCtx", ",", "error", ")", "{", "fndgLog", ".", "Infof", "(", ...
// cancelReservationCtx does all needed work in order to securely cancel the // reservation.
[ "cancelReservationCtx", "does", "all", "needed", "work", "in", "order", "to", "securely", "cancel", "the", "reservation", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L2983-L3019
128,954
lightningnetwork/lnd
fundingmanager.go
deleteReservationCtx
func (f *fundingManager) deleteReservationCtx(peerKey *btcec.PublicKey, pendingChanID [32]byte) { // TODO(roasbeef): possibly cancel funding barrier in peer's // channelManager? peerIDKey := newSerializedKey(peerKey) f.resMtx.Lock() defer f.resMtx.Unlock() nodeReservations, ok := f.activeReservations[peerIDKey...
go
func (f *fundingManager) deleteReservationCtx(peerKey *btcec.PublicKey, pendingChanID [32]byte) { // TODO(roasbeef): possibly cancel funding barrier in peer's // channelManager? peerIDKey := newSerializedKey(peerKey) f.resMtx.Lock() defer f.resMtx.Unlock() nodeReservations, ok := f.activeReservations[peerIDKey...
[ "func", "(", "f", "*", "fundingManager", ")", "deleteReservationCtx", "(", "peerKey", "*", "btcec", ".", "PublicKey", ",", "pendingChanID", "[", "32", "]", "byte", ")", "{", "// TODO(roasbeef): possibly cancel funding barrier in peer's", "// channelManager?", "peerIDKey...
// deleteReservationCtx deletes the reservation uniquely identified by the // target public key of the peer, and the specified pending channel ID.
[ "deleteReservationCtx", "deletes", "the", "reservation", "uniquely", "identified", "by", "the", "target", "public", "key", "of", "the", "peer", "and", "the", "specified", "pending", "channel", "ID", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L3023-L3044
128,955
lightningnetwork/lnd
fundingmanager.go
getReservationCtx
func (f *fundingManager) getReservationCtx(peerKey *btcec.PublicKey, pendingChanID [32]byte) (*reservationWithCtx, error) { peerIDKey := newSerializedKey(peerKey) f.resMtx.RLock() resCtx, ok := f.activeReservations[peerIDKey][pendingChanID] f.resMtx.RUnlock() if !ok { return nil, errors.Errorf("unknown channe...
go
func (f *fundingManager) getReservationCtx(peerKey *btcec.PublicKey, pendingChanID [32]byte) (*reservationWithCtx, error) { peerIDKey := newSerializedKey(peerKey) f.resMtx.RLock() resCtx, ok := f.activeReservations[peerIDKey][pendingChanID] f.resMtx.RUnlock() if !ok { return nil, errors.Errorf("unknown channe...
[ "func", "(", "f", "*", "fundingManager", ")", "getReservationCtx", "(", "peerKey", "*", "btcec", ".", "PublicKey", ",", "pendingChanID", "[", "32", "]", "byte", ")", "(", "*", "reservationWithCtx", ",", "error", ")", "{", "peerIDKey", ":=", "newSerializedKey...
// getReservationCtx returns the reservation context for a particular pending // channel ID for a target peer.
[ "getReservationCtx", "returns", "the", "reservation", "context", "for", "a", "particular", "pending", "channel", "ID", "for", "a", "target", "peer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L3048-L3062
128,956
lightningnetwork/lnd
fundingmanager.go
IsPendingChannel
func (f *fundingManager) IsPendingChannel(pendingChanID [32]byte, peerKey *btcec.PublicKey) bool { peerIDKey := newSerializedKey(peerKey) f.resMtx.RLock() _, ok := f.activeReservations[peerIDKey][pendingChanID] f.resMtx.RUnlock() return ok }
go
func (f *fundingManager) IsPendingChannel(pendingChanID [32]byte, peerKey *btcec.PublicKey) bool { peerIDKey := newSerializedKey(peerKey) f.resMtx.RLock() _, ok := f.activeReservations[peerIDKey][pendingChanID] f.resMtx.RUnlock() return ok }
[ "func", "(", "f", "*", "fundingManager", ")", "IsPendingChannel", "(", "pendingChanID", "[", "32", "]", "byte", ",", "peerKey", "*", "btcec", ".", "PublicKey", ")", "bool", "{", "peerIDKey", ":=", "newSerializedKey", "(", "peerKey", ")", "\n", "f", ".", ...
// IsPendingChannel returns a boolean indicating whether the channel identified // by the pendingChanID and given peer is pending, meaning it is in the process // of being funded. After the funding transaction has been confirmed, the // channel will receive a new, permanent channel ID, and will no longer be // consider...
[ "IsPendingChannel", "returns", "a", "boolean", "indicating", "whether", "the", "channel", "identified", "by", "the", "pendingChanID", "and", "given", "peer", "is", "pending", "meaning", "it", "is", "in", "the", "process", "of", "being", "funded", ".", "After", ...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L3069-L3078
128,957
lightningnetwork/lnd
fundingmanager.go
saveChannelOpeningState
func (f *fundingManager) saveChannelOpeningState(chanPoint *wire.OutPoint, state channelOpeningState, shortChanID *lnwire.ShortChannelID) error { return f.cfg.Wallet.Cfg.Database.Update(func(tx *bbolt.Tx) error { bucket, err := tx.CreateBucketIfNotExists(channelOpeningStateBucket) if err != nil { return err ...
go
func (f *fundingManager) saveChannelOpeningState(chanPoint *wire.OutPoint, state channelOpeningState, shortChanID *lnwire.ShortChannelID) error { return f.cfg.Wallet.Cfg.Database.Update(func(tx *bbolt.Tx) error { bucket, err := tx.CreateBucketIfNotExists(channelOpeningStateBucket) if err != nil { return err ...
[ "func", "(", "f", "*", "fundingManager", ")", "saveChannelOpeningState", "(", "chanPoint", "*", "wire", ".", "OutPoint", ",", "state", "channelOpeningState", ",", "shortChanID", "*", "lnwire", ".", "ShortChannelID", ")", "error", "{", "return", "f", ".", "cfg"...
// saveChannelOpeningState saves the channelOpeningState for the provided // chanPoint to the channelOpeningStateBucket.
[ "saveChannelOpeningState", "saves", "the", "channelOpeningState", "for", "the", "provided", "chanPoint", "to", "the", "channelOpeningStateBucket", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L3090-L3112
128,958
lightningnetwork/lnd
fundingmanager.go
getChannelOpeningState
func (f *fundingManager) getChannelOpeningState(chanPoint *wire.OutPoint) ( channelOpeningState, *lnwire.ShortChannelID, error) { var state channelOpeningState var shortChanID lnwire.ShortChannelID err := f.cfg.Wallet.Cfg.Database.View(func(tx *bbolt.Tx) error { bucket := tx.Bucket(channelOpeningStateBucket) ...
go
func (f *fundingManager) getChannelOpeningState(chanPoint *wire.OutPoint) ( channelOpeningState, *lnwire.ShortChannelID, error) { var state channelOpeningState var shortChanID lnwire.ShortChannelID err := f.cfg.Wallet.Cfg.Database.View(func(tx *bbolt.Tx) error { bucket := tx.Bucket(channelOpeningStateBucket) ...
[ "func", "(", "f", "*", "fundingManager", ")", "getChannelOpeningState", "(", "chanPoint", "*", "wire", ".", "OutPoint", ")", "(", "channelOpeningState", ",", "*", "lnwire", ".", "ShortChannelID", ",", "error", ")", "{", "var", "state", "channelOpeningState", "...
// getChannelOpeningState fetches the channelOpeningState for the provided // chanPoint from the database, or returns ErrChannelNotFound if the channel // is not found.
[ "getChannelOpeningState", "fetches", "the", "channelOpeningState", "for", "the", "provided", "chanPoint", "from", "the", "database", "or", "returns", "ErrChannelNotFound", "if", "the", "channel", "is", "not", "found", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L3117-L3150
128,959
lightningnetwork/lnd
fundingmanager.go
deleteChannelOpeningState
func (f *fundingManager) deleteChannelOpeningState(chanPoint *wire.OutPoint) error { return f.cfg.Wallet.Cfg.Database.Update(func(tx *bbolt.Tx) error { bucket := tx.Bucket(channelOpeningStateBucket) if bucket == nil { return fmt.Errorf("Bucket not found") } var outpointBytes bytes.Buffer if err := writeO...
go
func (f *fundingManager) deleteChannelOpeningState(chanPoint *wire.OutPoint) error { return f.cfg.Wallet.Cfg.Database.Update(func(tx *bbolt.Tx) error { bucket := tx.Bucket(channelOpeningStateBucket) if bucket == nil { return fmt.Errorf("Bucket not found") } var outpointBytes bytes.Buffer if err := writeO...
[ "func", "(", "f", "*", "fundingManager", ")", "deleteChannelOpeningState", "(", "chanPoint", "*", "wire", ".", "OutPoint", ")", "error", "{", "return", "f", ".", "cfg", ".", "Wallet", ".", "Cfg", ".", "Database", ".", "Update", "(", "func", "(", "tx", ...
// deleteChannelOpeningState removes any state for chanPoint from the database.
[ "deleteChannelOpeningState", "removes", "any", "state", "for", "chanPoint", "from", "the", "database", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/fundingmanager.go#L3153-L3167
128,960
lightningnetwork/lnd
lnwire/ping.go
Decode
func (p *Ping) Decode(r io.Reader, pver uint32) error { return ReadElements(r, &p.NumPongBytes, &p.PaddingBytes) }
go
func (p *Ping) Decode(r io.Reader, pver uint32) error { return ReadElements(r, &p.NumPongBytes, &p.PaddingBytes) }
[ "func", "(", "p", "*", "Ping", ")", "Decode", "(", "r", "io", ".", "Reader", ",", "pver", "uint32", ")", "error", "{", "return", "ReadElements", "(", "r", ",", "&", "p", ".", "NumPongBytes", ",", "&", "p", ".", "PaddingBytes", ")", "\n", "}" ]
// Decode deserializes a serialized Ping message stored in the passed io.Reader // observing the specified protocol version. // // This is part of the lnwire.Message interface.
[ "Decode", "deserializes", "a", "serialized", "Ping", "message", "stored", "in", "the", "passed", "io", ".", "Reader", "observing", "the", "specified", "protocol", "version", ".", "This", "is", "part", "of", "the", "lnwire", ".", "Message", "interface", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnwire/ping.go#L37-L41
128,961
lightningnetwork/lnd
lnwire/ping.go
Encode
func (p *Ping) Encode(w io.Writer, pver uint32) error { return WriteElements(w, p.NumPongBytes, p.PaddingBytes) }
go
func (p *Ping) Encode(w io.Writer, pver uint32) error { return WriteElements(w, p.NumPongBytes, p.PaddingBytes) }
[ "func", "(", "p", "*", "Ping", ")", "Encode", "(", "w", "io", ".", "Writer", ",", "pver", "uint32", ")", "error", "{", "return", "WriteElements", "(", "w", ",", "p", ".", "NumPongBytes", ",", "p", ".", "PaddingBytes", ")", "\n", "}" ]
// Encode serializes the target Ping into the passed io.Writer observing the // protocol version specified. // // This is part of the lnwire.Message interface.
[ "Encode", "serializes", "the", "target", "Ping", "into", "the", "passed", "io", ".", "Writer", "observing", "the", "protocol", "version", "specified", ".", "This", "is", "part", "of", "the", "lnwire", ".", "Message", "interface", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnwire/ping.go#L47-L51
128,962
lightningnetwork/lnd
lnrpc/walletrpc/walletkit_server.go
New
func New(cfg *Config) (*WalletKit, lnrpc.MacaroonPerms, error) { // If the path of the wallet kit macaroon wasn't specified, then we'll // assume that it's found at the default network directory. if cfg.WalletKitMacPath == "" { cfg.WalletKitMacPath = filepath.Join( cfg.NetworkDir, DefaultWalletKitMacFilename, ...
go
func New(cfg *Config) (*WalletKit, lnrpc.MacaroonPerms, error) { // If the path of the wallet kit macaroon wasn't specified, then we'll // assume that it's found at the default network directory. if cfg.WalletKitMacPath == "" { cfg.WalletKitMacPath = filepath.Join( cfg.NetworkDir, DefaultWalletKitMacFilename, ...
[ "func", "New", "(", "cfg", "*", "Config", ")", "(", "*", "WalletKit", ",", "lnrpc", ".", "MacaroonPerms", ",", "error", ")", "{", "// If the path of the wallet kit macaroon wasn't specified, then we'll", "// assume that it's found at the default network directory.", "if", "...
// New creates a new instance of the WalletKit sub-RPC server.
[ "New", "creates", "a", "new", "instance", "of", "the", "WalletKit", "sub", "-", "RPC", "server", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnrpc/walletrpc/walletkit_server.go#L97-L139
128,963
lightningnetwork/lnd
lnrpc/walletrpc/walletkit_server.go
DeriveKey
func (w *WalletKit) DeriveKey(ctx context.Context, req *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) { keyDesc, err := w.cfg.KeyRing.DeriveKey(keychain.KeyLocator{ Family: keychain.KeyFamily(req.KeyFamily), Index: uint32(req.KeyIndex), }) if err != nil { return nil, err } return &signrpc.KeyDescri...
go
func (w *WalletKit) DeriveKey(ctx context.Context, req *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) { keyDesc, err := w.cfg.KeyRing.DeriveKey(keychain.KeyLocator{ Family: keychain.KeyFamily(req.KeyFamily), Index: uint32(req.KeyIndex), }) if err != nil { return nil, err } return &signrpc.KeyDescri...
[ "func", "(", "w", "*", "WalletKit", ")", "DeriveKey", "(", "ctx", "context", ".", "Context", ",", "req", "*", "signrpc", ".", "KeyLocator", ")", "(", "*", "signrpc", ".", "KeyDescriptor", ",", "error", ")", "{", "keyDesc", ",", "err", ":=", "w", ".",...
// DeriveKey attempts to derive an arbitrary key specified by the passed // KeyLocator.
[ "DeriveKey", "attempts", "to", "derive", "an", "arbitrary", "key", "specified", "by", "the", "passed", "KeyLocator", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnrpc/walletrpc/walletkit_server.go#L203-L221
128,964
lightningnetwork/lnd
lnrpc/walletrpc/walletkit_server.go
NextAddr
func (w *WalletKit) NextAddr(ctx context.Context, req *AddrRequest) (*AddrResponse, error) { addr, err := w.cfg.Wallet.NewAddress(lnwallet.WitnessPubKey, false) if err != nil { return nil, err } return &AddrResponse{ Addr: addr.String(), }, nil }
go
func (w *WalletKit) NextAddr(ctx context.Context, req *AddrRequest) (*AddrResponse, error) { addr, err := w.cfg.Wallet.NewAddress(lnwallet.WitnessPubKey, false) if err != nil { return nil, err } return &AddrResponse{ Addr: addr.String(), }, nil }
[ "func", "(", "w", "*", "WalletKit", ")", "NextAddr", "(", "ctx", "context", ".", "Context", ",", "req", "*", "AddrRequest", ")", "(", "*", "AddrResponse", ",", "error", ")", "{", "addr", ",", "err", ":=", "w", ".", "cfg", ".", "Wallet", ".", "NewAd...
// NextAddr returns the next unused address within the wallet.
[ "NextAddr", "returns", "the", "next", "unused", "address", "within", "the", "wallet", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnrpc/walletrpc/walletkit_server.go#L224-L235
128,965
lightningnetwork/lnd
lnrpc/walletrpc/walletkit_server.go
PublishTransaction
func (w *WalletKit) PublishTransaction(ctx context.Context, req *Transaction) (*PublishResponse, error) { switch { // If the client doesn't specify a transaction, then there's nothing to // publish. case len(req.TxHex) == 0: return nil, fmt.Errorf("must provide a transaction to " + "publish") } tx := &wir...
go
func (w *WalletKit) PublishTransaction(ctx context.Context, req *Transaction) (*PublishResponse, error) { switch { // If the client doesn't specify a transaction, then there's nothing to // publish. case len(req.TxHex) == 0: return nil, fmt.Errorf("must provide a transaction to " + "publish") } tx := &wir...
[ "func", "(", "w", "*", "WalletKit", ")", "PublishTransaction", "(", "ctx", "context", ".", "Context", ",", "req", "*", "Transaction", ")", "(", "*", "PublishResponse", ",", "error", ")", "{", "switch", "{", "// If the client doesn't specify a transaction, then the...
// Attempts to publish the passed transaction to the network. Once this returns // without an error, the wallet will continually attempt to re-broadcast the // transaction on start up, until it enters the chain.
[ "Attempts", "to", "publish", "the", "passed", "transaction", "to", "the", "network", ".", "Once", "this", "returns", "without", "an", "error", "the", "wallet", "will", "continually", "attempt", "to", "re", "-", "broadcast", "the", "transaction", "on", "start",...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnrpc/walletrpc/walletkit_server.go#L240-L263
128,966
lightningnetwork/lnd
lnrpc/walletrpc/walletkit_server.go
SendOutputs
func (w *WalletKit) SendOutputs(ctx context.Context, req *SendOutputsRequest) (*SendOutputsResponse, error) { switch { // If the client didn't specify any outputs to create, then we can't // proceed . case len(req.Outputs) == 0: return nil, fmt.Errorf("must specify at least one output " + "to create") } ...
go
func (w *WalletKit) SendOutputs(ctx context.Context, req *SendOutputsRequest) (*SendOutputsResponse, error) { switch { // If the client didn't specify any outputs to create, then we can't // proceed . case len(req.Outputs) == 0: return nil, fmt.Errorf("must specify at least one output " + "to create") } ...
[ "func", "(", "w", "*", "WalletKit", ")", "SendOutputs", "(", "ctx", "context", ".", "Context", ",", "req", "*", "SendOutputsRequest", ")", "(", "*", "SendOutputsResponse", ",", "error", ")", "{", "switch", "{", "// If the client didn't specify any outputs to creat...
// SendOutputs is similar to the existing sendmany call in Bitcoind, and allows // the caller to create a transaction that sends to several outputs at once. // This is ideal when wanting to batch create a set of transactions.
[ "SendOutputs", "is", "similar", "to", "the", "existing", "sendmany", "call", "in", "Bitcoind", "and", "allows", "the", "caller", "to", "create", "a", "transaction", "that", "sends", "to", "several", "outputs", "at", "once", ".", "This", "is", "ideal", "when"...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/lnrpc/walletrpc/walletkit_server.go#L268-L307
128,967
lightningnetwork/lnd
channeldb/channel.go
String
func (c ChannelStatus) String() string { // If no flags are set, then this is the default case. if c == 0 { return chanStatusStrings[ChanStatusDefault] } // Add individual bit flags. statusStr := "" for _, flag := range orderedChanStatusFlags { if c&flag == flag { statusStr += chanStatusStrings[flag] + "|...
go
func (c ChannelStatus) String() string { // If no flags are set, then this is the default case. if c == 0 { return chanStatusStrings[ChanStatusDefault] } // Add individual bit flags. statusStr := "" for _, flag := range orderedChanStatusFlags { if c&flag == flag { statusStr += chanStatusStrings[flag] + "|...
[ "func", "(", "c", "ChannelStatus", ")", "String", "(", ")", "string", "{", "// If no flags are set, then this is the default case.", "if", "c", "==", "0", "{", "return", "chanStatusStrings", "[", "ChanStatusDefault", "]", "\n", "}", "\n\n", "// Add individual bit flag...
// String returns a human-readable representation of the ChannelStatus.
[ "String", "returns", "a", "human", "-", "readable", "representation", "of", "the", "ChannelStatus", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L354-L382
128,968
lightningnetwork/lnd
channeldb/channel.go
ShortChanID
func (c *OpenChannel) ShortChanID() lnwire.ShortChannelID { c.RLock() defer c.RUnlock() return c.ShortChannelID }
go
func (c *OpenChannel) ShortChanID() lnwire.ShortChannelID { c.RLock() defer c.RUnlock() return c.ShortChannelID }
[ "func", "(", "c", "*", "OpenChannel", ")", "ShortChanID", "(", ")", "lnwire", ".", "ShortChannelID", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "return", "c", ".", "ShortChannelID", "\n", "}" ]
// ShortChanID returns the current ShortChannelID of this channel.
[ "ShortChanID", "returns", "the", "current", "ShortChannelID", "of", "this", "channel", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L528-L533
128,969
lightningnetwork/lnd
channeldb/channel.go
ChanStatus
func (c *OpenChannel) ChanStatus() ChannelStatus { c.RLock() defer c.RUnlock() return c.chanStatus }
go
func (c *OpenChannel) ChanStatus() ChannelStatus { c.RLock() defer c.RUnlock() return c.chanStatus }
[ "func", "(", "c", "*", "OpenChannel", ")", "ChanStatus", "(", ")", "ChannelStatus", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "return", "c", ".", "chanStatus", "\n", "}" ]
// ChanStatus returns the current ChannelStatus of this channel.
[ "ChanStatus", "returns", "the", "current", "ChannelStatus", "of", "this", "channel", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L536-L541
128,970
lightningnetwork/lnd
channeldb/channel.go
ApplyChanStatus
func (c *OpenChannel) ApplyChanStatus(status ChannelStatus) error { c.Lock() defer c.Unlock() return c.putChanStatus(status) }
go
func (c *OpenChannel) ApplyChanStatus(status ChannelStatus) error { c.Lock() defer c.Unlock() return c.putChanStatus(status) }
[ "func", "(", "c", "*", "OpenChannel", ")", "ApplyChanStatus", "(", "status", "ChannelStatus", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "return", "c", ".", "putChanStatus", "(", "status", ")", ...
// ApplyChanStatus allows the caller to modify the internal channel state in a // thead-safe manner.
[ "ApplyChanStatus", "allows", "the", "caller", "to", "modify", "the", "internal", "channel", "state", "in", "a", "thead", "-", "safe", "manner", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L545-L550
128,971
lightningnetwork/lnd
channeldb/channel.go
HasChanStatus
func (c *OpenChannel) HasChanStatus(status ChannelStatus) bool { c.RLock() defer c.RUnlock() return c.hasChanStatus(status) }
go
func (c *OpenChannel) HasChanStatus(status ChannelStatus) bool { c.RLock() defer c.RUnlock() return c.hasChanStatus(status) }
[ "func", "(", "c", "*", "OpenChannel", ")", "HasChanStatus", "(", "status", "ChannelStatus", ")", "bool", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "return", "c", ".", "hasChanStatus", "(", "status", ")", ...
// HasChanStatus returns true if the internal bitfield channel status of the // target channel has the specified status bit set.
[ "HasChanStatus", "returns", "true", "if", "the", "internal", "bitfield", "channel", "status", "of", "the", "target", "channel", "has", "the", "specified", "status", "bit", "set", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L564-L569
128,972
lightningnetwork/lnd
channeldb/channel.go
RefreshShortChanID
func (c *OpenChannel) RefreshShortChanID() error { c.Lock() defer c.Unlock() var sid lnwire.ShortChannelID err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } channel, err := fetchOpenCha...
go
func (c *OpenChannel) RefreshShortChanID() error { c.Lock() defer c.Unlock() var sid lnwire.ShortChannelID err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } channel, err := fetchOpenCha...
[ "func", "(", "c", "*", "OpenChannel", ")", "RefreshShortChanID", "(", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "var", "sid", "lnwire", ".", "ShortChannelID", "\n", "err", ":=", "c", ".", "D...
// RefreshShortChanID updates the in-memory short channel ID using the latest // value observed on disk.
[ "RefreshShortChanID", "updates", "the", "in", "-", "memory", "short", "channel", "ID", "using", "the", "latest", "value", "observed", "on", "disk", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L577-L607
128,973
lightningnetwork/lnd
channeldb/channel.go
fullSync
func (c *OpenChannel) fullSync(tx *bbolt.Tx) error { // First fetch the top level bucket which stores all data related to // current, active channels. openChanBucket, err := tx.CreateBucketIfNotExists(openChannelBucket) if err != nil { return err } // Within this top level bucket, fetch the bucket dedicated to...
go
func (c *OpenChannel) fullSync(tx *bbolt.Tx) error { // First fetch the top level bucket which stores all data related to // current, active channels. openChanBucket, err := tx.CreateBucketIfNotExists(openChannelBucket) if err != nil { return err } // Within this top level bucket, fetch the bucket dedicated to...
[ "func", "(", "c", "*", "OpenChannel", ")", "fullSync", "(", "tx", "*", "bbolt", ".", "Tx", ")", "error", "{", "// First fetch the top level bucket which stores all data related to", "// current, active channels.", "openChanBucket", ",", "err", ":=", "tx", ".", "Create...
// fullSync is an internal version of the FullSync method which allows callers // to sync the contents of an OpenChannel while re-using an existing database // transaction.
[ "fullSync", "is", "an", "internal", "version", "of", "the", "FullSync", "method", "which", "allows", "callers", "to", "sync", "the", "contents", "of", "an", "OpenChannel", "while", "re", "-", "using", "an", "existing", "database", "transaction", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L654-L696
128,974
lightningnetwork/lnd
channeldb/channel.go
MarkAsOpen
func (c *OpenChannel) MarkAsOpen(openLoc lnwire.ShortChannelID) error { c.Lock() defer c.Unlock() if err := c.Db.Update(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } channel, err := fetchOpenChannel(...
go
func (c *OpenChannel) MarkAsOpen(openLoc lnwire.ShortChannelID) error { c.Lock() defer c.Unlock() if err := c.Db.Update(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } channel, err := fetchOpenChannel(...
[ "func", "(", "c", "*", "OpenChannel", ")", "MarkAsOpen", "(", "openLoc", "lnwire", ".", "ShortChannelID", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "if", "err", ":=", "c", ".", "Db", ".", ...
// MarkAsOpen marks a channel as fully open given a locator that uniquely // describes its location within the chain.
[ "MarkAsOpen", "marks", "a", "channel", "as", "fully", "open", "given", "a", "locator", "that", "uniquely", "describes", "its", "location", "within", "the", "chain", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L700-L730
128,975
lightningnetwork/lnd
channeldb/channel.go
MarkDataLoss
func (c *OpenChannel) MarkDataLoss(commitPoint *btcec.PublicKey) error { c.Lock() defer c.Unlock() var status ChannelStatus if err := c.Db.Update(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } channe...
go
func (c *OpenChannel) MarkDataLoss(commitPoint *btcec.PublicKey) error { c.Lock() defer c.Unlock() var status ChannelStatus if err := c.Db.Update(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } channe...
[ "func", "(", "c", "*", "OpenChannel", ")", "MarkDataLoss", "(", "commitPoint", "*", "btcec", ".", "PublicKey", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "var", "status", "ChannelStatus", "\n", ...
// MarkDataLoss marks sets the channel status to LocalDataLoss and stores the // passed commitPoint for use to retrieve funds in case the remote force closes // the channel.
[ "MarkDataLoss", "marks", "sets", "the", "channel", "status", "to", "LocalDataLoss", "and", "stores", "the", "passed", "commitPoint", "for", "use", "to", "retrieve", "funds", "in", "case", "the", "remote", "force", "closes", "the", "channel", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L735-L777
128,976
lightningnetwork/lnd
channeldb/channel.go
DataLossCommitPoint
func (c *OpenChannel) DataLossCommitPoint() (*btcec.PublicKey, error) { var commitPoint *btcec.PublicKey err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) switch err { case nil: case ErrNoChanDBExists, ErrNoActiveChannel...
go
func (c *OpenChannel) DataLossCommitPoint() (*btcec.PublicKey, error) { var commitPoint *btcec.PublicKey err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) switch err { case nil: case ErrNoChanDBExists, ErrNoActiveChannel...
[ "func", "(", "c", "*", "OpenChannel", ")", "DataLossCommitPoint", "(", ")", "(", "*", "btcec", ".", "PublicKey", ",", "error", ")", "{", "var", "commitPoint", "*", "btcec", ".", "PublicKey", "\n\n", "err", ":=", "c", ".", "Db", ".", "View", "(", "fun...
// DataLossCommitPoint retrieves the stored commit point set during // MarkDataLoss. If not found ErrNoCommitPoint is returned.
[ "DataLossCommitPoint", "retrieves", "the", "stored", "commit", "point", "set", "during", "MarkDataLoss", ".", "If", "not", "found", "ErrNoCommitPoint", "is", "returned", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L781-L812
128,977
lightningnetwork/lnd
channeldb/channel.go
MarkBorked
func (c *OpenChannel) MarkBorked() error { c.Lock() defer c.Unlock() return c.putChanStatus(ChanStatusBorked) }
go
func (c *OpenChannel) MarkBorked() error { c.Lock() defer c.Unlock() return c.putChanStatus(ChanStatusBorked) }
[ "func", "(", "c", "*", "OpenChannel", ")", "MarkBorked", "(", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "return", "c", ".", "putChanStatus", "(", "ChanStatusBorked", ")", "\n", "}" ]
// MarkBorked marks the event when the channel as reached an irreconcilable // state, such as a channel breach or state desynchronization. Borked channels // should never be added to the switch.
[ "MarkBorked", "marks", "the", "event", "when", "the", "channel", "as", "reached", "an", "irreconcilable", "state", "such", "as", "a", "channel", "breach", "or", "state", "desynchronization", ".", "Borked", "channels", "should", "never", "be", "added", "to", "t...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L817-L822
128,978
lightningnetwork/lnd
channeldb/channel.go
putOpenChannel
func putOpenChannel(chanBucket *bbolt.Bucket, channel *OpenChannel) error { // First, we'll write out all the relatively static fields, that are // decided upon initial channel creation. if err := putChanInfo(chanBucket, channel); err != nil { return fmt.Errorf("unable to store chan info: %v", err) } // With th...
go
func putOpenChannel(chanBucket *bbolt.Bucket, channel *OpenChannel) error { // First, we'll write out all the relatively static fields, that are // decided upon initial channel creation. if err := putChanInfo(chanBucket, channel); err != nil { return fmt.Errorf("unable to store chan info: %v", err) } // With th...
[ "func", "putOpenChannel", "(", "chanBucket", "*", "bbolt", ".", "Bucket", ",", "channel", "*", "OpenChannel", ")", "error", "{", "// First, we'll write out all the relatively static fields, that are", "// decided upon initial channel creation.", "if", "err", ":=", "putChanInf...
// putChannel serializes, and stores the current state of the channel in its // entirety.
[ "putChannel", "serializes", "and", "stores", "the", "current", "state", "of", "the", "channel", "in", "its", "entirety", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L908-L928
128,979
lightningnetwork/lnd
channeldb/channel.go
Copy
func (h *HTLC) Copy() HTLC { clone := HTLC{ Incoming: h.Incoming, Amt: h.Amt, RefundTimeout: h.RefundTimeout, OutputIndex: h.OutputIndex, } copy(clone.Signature[:], h.Signature) copy(clone.RHash[:], h.RHash[:]) return clone }
go
func (h *HTLC) Copy() HTLC { clone := HTLC{ Incoming: h.Incoming, Amt: h.Amt, RefundTimeout: h.RefundTimeout, OutputIndex: h.OutputIndex, } copy(clone.Signature[:], h.Signature) copy(clone.RHash[:], h.RHash[:]) return clone }
[ "func", "(", "h", "*", "HTLC", ")", "Copy", "(", ")", "HTLC", "{", "clone", ":=", "HTLC", "{", "Incoming", ":", "h", ".", "Incoming", ",", "Amt", ":", "h", ".", "Amt", ",", "RefundTimeout", ":", "h", ".", "RefundTimeout", ",", "OutputIndex", ":", ...
// Copy returns a full copy of the target HTLC.
[ "Copy", "returns", "a", "full", "copy", "of", "the", "target", "HTLC", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1178-L1189
128,980
lightningnetwork/lnd
channeldb/channel.go
Encode
func (l *LogUpdate) Encode(w io.Writer) error { return WriteElements(w, l.LogIndex, l.UpdateMsg) }
go
func (l *LogUpdate) Encode(w io.Writer) error { return WriteElements(w, l.LogIndex, l.UpdateMsg) }
[ "func", "(", "l", "*", "LogUpdate", ")", "Encode", "(", "w", "io", ".", "Writer", ")", "error", "{", "return", "WriteElements", "(", "w", ",", "l", ".", "LogIndex", ",", "l", ".", "UpdateMsg", ")", "\n", "}" ]
// Encode writes a log update to the provided io.Writer.
[ "Encode", "writes", "a", "log", "update", "to", "the", "provided", "io", ".", "Writer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1207-L1209
128,981
lightningnetwork/lnd
channeldb/channel.go
Decode
func (l *LogUpdate) Decode(r io.Reader) error { return ReadElements(r, &l.LogIndex, &l.UpdateMsg) }
go
func (l *LogUpdate) Decode(r io.Reader) error { return ReadElements(r, &l.LogIndex, &l.UpdateMsg) }
[ "func", "(", "l", "*", "LogUpdate", ")", "Decode", "(", "r", "io", ".", "Reader", ")", "error", "{", "return", "ReadElements", "(", "r", ",", "&", "l", ".", "LogIndex", ",", "&", "l", ".", "UpdateMsg", ")", "\n", "}" ]
// Decode reads a log update from the provided io.Reader.
[ "Decode", "reads", "a", "log", "update", "from", "the", "provided", "io", ".", "Reader", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1212-L1214
128,982
lightningnetwork/lnd
channeldb/channel.go
SetBytes
func (k *CircuitKey) SetBytes(bs []byte) error { if len(bs) != 16 { return ErrInvalidCircuitKeyLen } k.ChanID = lnwire.NewShortChanIDFromInt( binary.BigEndian.Uint64(bs[:8])) k.HtlcID = binary.BigEndian.Uint64(bs[8:]) return nil }
go
func (k *CircuitKey) SetBytes(bs []byte) error { if len(bs) != 16 { return ErrInvalidCircuitKeyLen } k.ChanID = lnwire.NewShortChanIDFromInt( binary.BigEndian.Uint64(bs[:8])) k.HtlcID = binary.BigEndian.Uint64(bs[8:]) return nil }
[ "func", "(", "k", "*", "CircuitKey", ")", "SetBytes", "(", "bs", "[", "]", "byte", ")", "error", "{", "if", "len", "(", "bs", ")", "!=", "16", "{", "return", "ErrInvalidCircuitKeyLen", "\n", "}", "\n\n", "k", ".", "ChanID", "=", "lnwire", ".", "New...
// SetBytes deserializes the given bytes into this CircuitKey.
[ "SetBytes", "deserializes", "the", "given", "bytes", "into", "this", "CircuitKey", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1235-L1245
128,983
lightningnetwork/lnd
channeldb/channel.go
Bytes
func (k CircuitKey) Bytes() []byte { var bs = make([]byte, 16) binary.BigEndian.PutUint64(bs[:8], k.ChanID.ToUint64()) binary.BigEndian.PutUint64(bs[8:], k.HtlcID) return bs }
go
func (k CircuitKey) Bytes() []byte { var bs = make([]byte, 16) binary.BigEndian.PutUint64(bs[:8], k.ChanID.ToUint64()) binary.BigEndian.PutUint64(bs[8:], k.HtlcID) return bs }
[ "func", "(", "k", "CircuitKey", ")", "Bytes", "(", ")", "[", "]", "byte", "{", "var", "bs", "=", "make", "(", "[", "]", "byte", ",", "16", ")", "\n", "binary", ".", "BigEndian", ".", "PutUint64", "(", "bs", "[", ":", "8", "]", ",", "k", ".", ...
// Bytes returns the serialized bytes for this circuit key.
[ "Bytes", "returns", "the", "serialized", "bytes", "for", "this", "circuit", "key", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1248-L1253
128,984
lightningnetwork/lnd
channeldb/channel.go
Encode
func (k *CircuitKey) Encode(w io.Writer) error { var scratch [16]byte binary.BigEndian.PutUint64(scratch[:8], k.ChanID.ToUint64()) binary.BigEndian.PutUint64(scratch[8:], k.HtlcID) _, err := w.Write(scratch[:]) return err }
go
func (k *CircuitKey) Encode(w io.Writer) error { var scratch [16]byte binary.BigEndian.PutUint64(scratch[:8], k.ChanID.ToUint64()) binary.BigEndian.PutUint64(scratch[8:], k.HtlcID) _, err := w.Write(scratch[:]) return err }
[ "func", "(", "k", "*", "CircuitKey", ")", "Encode", "(", "w", "io", ".", "Writer", ")", "error", "{", "var", "scratch", "[", "16", "]", "byte", "\n", "binary", ".", "BigEndian", ".", "PutUint64", "(", "scratch", "[", ":", "8", "]", ",", "k", ".",...
// Encode writes a CircuitKey to the provided io.Writer.
[ "Encode", "writes", "a", "CircuitKey", "to", "the", "provided", "io", ".", "Writer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1256-L1263
128,985
lightningnetwork/lnd
channeldb/channel.go
Decode
func (k *CircuitKey) Decode(r io.Reader) error { var scratch [16]byte if _, err := io.ReadFull(r, scratch[:]); err != nil { return err } k.ChanID = lnwire.NewShortChanIDFromInt( binary.BigEndian.Uint64(scratch[:8])) k.HtlcID = binary.BigEndian.Uint64(scratch[8:]) return nil }
go
func (k *CircuitKey) Decode(r io.Reader) error { var scratch [16]byte if _, err := io.ReadFull(r, scratch[:]); err != nil { return err } k.ChanID = lnwire.NewShortChanIDFromInt( binary.BigEndian.Uint64(scratch[:8])) k.HtlcID = binary.BigEndian.Uint64(scratch[8:]) return nil }
[ "func", "(", "k", "*", "CircuitKey", ")", "Decode", "(", "r", "io", ".", "Reader", ")", "error", "{", "var", "scratch", "[", "16", "]", "byte", "\n\n", "if", "_", ",", "err", ":=", "io", ".", "ReadFull", "(", "r", ",", "scratch", "[", ":", "]",...
// Decode reads a CircuitKey from the provided io.Reader.
[ "Decode", "reads", "a", "CircuitKey", "from", "the", "provided", "io", ".", "Reader", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1266-L1277
128,986
lightningnetwork/lnd
channeldb/channel.go
String
func (k CircuitKey) String() string { return fmt.Sprintf("(Chan ID=%s, HTLC ID=%d)", k.ChanID, k.HtlcID) }
go
func (k CircuitKey) String() string { return fmt.Sprintf("(Chan ID=%s, HTLC ID=%d)", k.ChanID, k.HtlcID) }
[ "func", "(", "k", "CircuitKey", ")", "String", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "k", ".", "ChanID", ",", "k", ".", "HtlcID", ")", "\n", "}" ]
// String returns a string representation of the CircuitKey.
[ "String", "returns", "a", "string", "representation", "of", "the", "CircuitKey", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1280-L1282
128,987
lightningnetwork/lnd
channeldb/channel.go
AppendRemoteCommitChain
func (c *OpenChannel) AppendRemoteCommitChain(diff *CommitDiff) error { c.Lock() defer c.Unlock() // If this is a restored channel, then we want to avoid mutating the // state as all, as it's impossible to do so in a protocol compliant // manner. if c.hasChanStatus(ChanStatusRestored) { return ErrNoRestoredCha...
go
func (c *OpenChannel) AppendRemoteCommitChain(diff *CommitDiff) error { c.Lock() defer c.Unlock() // If this is a restored channel, then we want to avoid mutating the // state as all, as it's impossible to do so in a protocol compliant // manner. if c.hasChanStatus(ChanStatusRestored) { return ErrNoRestoredCha...
[ "func", "(", "c", "*", "OpenChannel", ")", "AppendRemoteCommitChain", "(", "diff", "*", "CommitDiff", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "// If this is a restored channel, then we want to avoid mut...
// AppendRemoteCommitChain appends a new CommitDiff to the end of the // commitment chain for the remote party. This method is to be used once we // have prepared a new commitment state for the remote party, but before we // transmit it to the remote party. The contents of the argument should be // sufficient to retran...
[ "AppendRemoteCommitChain", "appends", "a", "new", "CommitDiff", "to", "the", "end", "of", "the", "commitment", "chain", "for", "the", "remote", "party", ".", "This", "method", "is", "to", "be", "used", "once", "we", "have", "prepared", "a", "new", "commitmen...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1457-L1518
128,988
lightningnetwork/lnd
channeldb/channel.go
AdvanceCommitChainTail
func (c *OpenChannel) AdvanceCommitChainTail(fwdPkg *FwdPkg) error { c.Lock() defer c.Unlock() // If this is a restored channel, then we want to avoid mutating the // state as all, as it's impossible to do so in a protocol compliant // manner. if c.hasChanStatus(ChanStatusRestored) { return ErrNoRestoredChanne...
go
func (c *OpenChannel) AdvanceCommitChainTail(fwdPkg *FwdPkg) error { c.Lock() defer c.Unlock() // If this is a restored channel, then we want to avoid mutating the // state as all, as it's impossible to do so in a protocol compliant // manner. if c.hasChanStatus(ChanStatusRestored) { return ErrNoRestoredChanne...
[ "func", "(", "c", "*", "OpenChannel", ")", "AdvanceCommitChainTail", "(", "fwdPkg", "*", "FwdPkg", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "// If this is a restored channel, then we want to avoid mutati...
// AdvanceCommitChainTail records the new state transition within an on-disk // append-only log which records all state transitions by the remote peer. In // the case of an uncooperative broadcast of a prior state by the remote peer, // this log can be consulted in order to reconstruct the state needed to // rectify th...
[ "AdvanceCommitChainTail", "records", "the", "new", "state", "transition", "within", "an", "on", "-", "disk", "append", "-", "only", "log", "which", "records", "all", "state", "transitions", "by", "the", "remote", "peer", ".", "In", "the", "case", "of", "an",...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1598-L1698
128,989
lightningnetwork/lnd
channeldb/channel.go
LoadFwdPkgs
func (c *OpenChannel) LoadFwdPkgs() ([]*FwdPkg, error) { c.RLock() defer c.RUnlock() var fwdPkgs []*FwdPkg if err := c.Db.View(func(tx *bbolt.Tx) error { var err error fwdPkgs, err = c.Packager.LoadFwdPkgs(tx) return err }); err != nil { return nil, err } return fwdPkgs, nil }
go
func (c *OpenChannel) LoadFwdPkgs() ([]*FwdPkg, error) { c.RLock() defer c.RUnlock() var fwdPkgs []*FwdPkg if err := c.Db.View(func(tx *bbolt.Tx) error { var err error fwdPkgs, err = c.Packager.LoadFwdPkgs(tx) return err }); err != nil { return nil, err } return fwdPkgs, nil }
[ "func", "(", "c", "*", "OpenChannel", ")", "LoadFwdPkgs", "(", ")", "(", "[", "]", "*", "FwdPkg", ",", "error", ")", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "var", "fwdPkgs", "[", "]", "*", "FwdPk...
// LoadFwdPkgs scans the forwarding log for any packages that haven't been // processed, and returns their deserialized log updates in map indexed by the // remote commitment height at which the updates were locked in.
[ "LoadFwdPkgs", "scans", "the", "forwarding", "log", "for", "any", "packages", "that", "haven", "t", "been", "processed", "and", "returns", "their", "deserialized", "log", "updates", "in", "map", "indexed", "by", "the", "remote", "commitment", "height", "at", "...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1726-L1740
128,990
lightningnetwork/lnd
channeldb/channel.go
AckAddHtlcs
func (c *OpenChannel) AckAddHtlcs(addRefs ...AddRef) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { return c.Packager.AckAddHtlcs(tx, addRefs...) }) }
go
func (c *OpenChannel) AckAddHtlcs(addRefs ...AddRef) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { return c.Packager.AckAddHtlcs(tx, addRefs...) }) }
[ "func", "(", "c", "*", "OpenChannel", ")", "AckAddHtlcs", "(", "addRefs", "...", "AddRef", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "return", "c", ".", "Db", ".", "Update", "(", "func", "...
// AckAddHtlcs updates the AckAddFilter containing any of the provided AddRefs // indicating that a response to this Add has been committed to the remote party. // Doing so will prevent these Add HTLCs from being reforwarded internally.
[ "AckAddHtlcs", "updates", "the", "AckAddFilter", "containing", "any", "of", "the", "provided", "AddRefs", "indicating", "that", "a", "response", "to", "this", "Add", "has", "been", "committed", "to", "the", "remote", "party", ".", "Doing", "so", "will", "preve...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1745-L1752
128,991
lightningnetwork/lnd
channeldb/channel.go
AckSettleFails
func (c *OpenChannel) AckSettleFails(settleFailRefs ...SettleFailRef) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { return c.Packager.AckSettleFails(tx, settleFailRefs...) }) }
go
func (c *OpenChannel) AckSettleFails(settleFailRefs ...SettleFailRef) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { return c.Packager.AckSettleFails(tx, settleFailRefs...) }) }
[ "func", "(", "c", "*", "OpenChannel", ")", "AckSettleFails", "(", "settleFailRefs", "...", "SettleFailRef", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "return", "c", ".", "Db", ".", "Update", "...
// AckSettleFails updates the SettleFailFilter containing any of the provided // SettleFailRefs, indicating that the response has been delivered to the // incoming link, corresponding to a particular AddRef. Doing so will prevent // the responses from being retransmitted internally.
[ "AckSettleFails", "updates", "the", "SettleFailFilter", "containing", "any", "of", "the", "provided", "SettleFailRefs", "indicating", "that", "the", "response", "has", "been", "delivered", "to", "the", "incoming", "link", "corresponding", "to", "a", "particular", "A...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1758-L1765
128,992
lightningnetwork/lnd
channeldb/channel.go
SetFwdFilter
func (c *OpenChannel) SetFwdFilter(height uint64, fwdFilter *PkgFilter) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { return c.Packager.SetFwdFilter(tx, height, fwdFilter) }) }
go
func (c *OpenChannel) SetFwdFilter(height uint64, fwdFilter *PkgFilter) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { return c.Packager.SetFwdFilter(tx, height, fwdFilter) }) }
[ "func", "(", "c", "*", "OpenChannel", ")", "SetFwdFilter", "(", "height", "uint64", ",", "fwdFilter", "*", "PkgFilter", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "return", "c", ".", "Db", "....
// SetFwdFilter atomically sets the forwarding filter for the forwarding package // identified by `height`.
[ "SetFwdFilter", "atomically", "sets", "the", "forwarding", "filter", "for", "the", "forwarding", "package", "identified", "by", "height", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1769-L1776
128,993
lightningnetwork/lnd
channeldb/channel.go
CommitmentHeight
func (c *OpenChannel) CommitmentHeight() (uint64, error) { c.RLock() defer c.RUnlock() var height uint64 err := c.Db.View(func(tx *bbolt.Tx) error { // Get the bucket dedicated to storing the metadata for open // channels. chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainH...
go
func (c *OpenChannel) CommitmentHeight() (uint64, error) { c.RLock() defer c.RUnlock() var height uint64 err := c.Db.View(func(tx *bbolt.Tx) error { // Get the bucket dedicated to storing the metadata for open // channels. chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainH...
[ "func", "(", "c", "*", "OpenChannel", ")", "CommitmentHeight", "(", ")", "(", "uint64", ",", "error", ")", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "var", "height", "uint64", "\n", "err", ":=", "c", ...
// CommitmentHeight returns the current commitment height. The commitment // height represents the number of updates to the commitment state to data. // This value is always monotonically increasing. This method is provided in // order to allow multiple instances of a particular open channel to obtain a // consistent v...
[ "CommitmentHeight", "returns", "the", "current", "commitment", "height", ".", "The", "commitment", "height", "represents", "the", "number", "of", "updates", "to", "the", "commitment", "state", "to", "data", ".", "This", "value", "is", "always", "monotonically", ...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1848-L1876
128,994
lightningnetwork/lnd
channeldb/channel.go
FindPreviousState
func (c *OpenChannel) FindPreviousState(updateNum uint64) (*ChannelCommitment, error) { c.RLock() defer c.RUnlock() var commit ChannelCommitment err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return e...
go
func (c *OpenChannel) FindPreviousState(updateNum uint64) (*ChannelCommitment, error) { c.RLock() defer c.RUnlock() var commit ChannelCommitment err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return e...
[ "func", "(", "c", "*", "OpenChannel", ")", "FindPreviousState", "(", "updateNum", "uint64", ")", "(", "*", "ChannelCommitment", ",", "error", ")", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "var", "commit", ...
// FindPreviousState scans through the append-only log in an attempt to recover // the previous channel state indicated by the update number. This method is // intended to be used for obtaining the relevant data needed to claim all // funds rightfully spendable in the case of an on-chain broadcast of the // commitment ...
[ "FindPreviousState", "scans", "through", "the", "append", "-", "only", "log", "in", "an", "attempt", "to", "recover", "the", "previous", "channel", "state", "indicated", "by", "the", "update", "number", ".", "This", "method", "is", "intended", "to", "be", "u...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L1883-L1914
128,995
lightningnetwork/lnd
channeldb/channel.go
CloseChannel
func (c *OpenChannel) CloseChannel(summary *ChannelCloseSummary) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { openChanBucket := tx.Bucket(openChannelBucket) if openChanBucket == nil { return ErrNoChanDBExists } nodePub := c.IdentityPub.SerializeCompressed() nodeChanB...
go
func (c *OpenChannel) CloseChannel(summary *ChannelCloseSummary) error { c.Lock() defer c.Unlock() return c.Db.Update(func(tx *bbolt.Tx) error { openChanBucket := tx.Bucket(openChannelBucket) if openChanBucket == nil { return ErrNoChanDBExists } nodePub := c.IdentityPub.SerializeCompressed() nodeChanB...
[ "func", "(", "c", "*", "OpenChannel", ")", "CloseChannel", "(", "summary", "*", "ChannelCloseSummary", ")", "error", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n\n", "return", "c", ".", "Db", ".", "Update", "(", ...
// CloseChannel closes a previously active Lightning channel. Closing a channel // entails deleting all saved state within the database concerning this // channel. This method also takes a struct that summarizes the state of the // channel at closing, this compact representation will be the only component // of a chann...
[ "CloseChannel", "closes", "a", "previously", "active", "Lightning", "channel", ".", "Closing", "a", "channel", "entails", "deleting", "all", "saved", "state", "within", "the", "database", "concerning", "this", "channel", ".", "This", "method", "also", "takes", "...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L2038-L2111
128,996
lightningnetwork/lnd
channeldb/channel.go
Snapshot
func (c *OpenChannel) Snapshot() *ChannelSnapshot { c.RLock() defer c.RUnlock() localCommit := c.LocalCommitment snapshot := &ChannelSnapshot{ RemoteIdentity: *c.IdentityPub, ChannelPoint: c.FundingOutpoint, Capacity: c.Capacity, TotalMSatSent: c.TotalMSatSent, TotalMSatReceived: c.T...
go
func (c *OpenChannel) Snapshot() *ChannelSnapshot { c.RLock() defer c.RUnlock() localCommit := c.LocalCommitment snapshot := &ChannelSnapshot{ RemoteIdentity: *c.IdentityPub, ChannelPoint: c.FundingOutpoint, Capacity: c.Capacity, TotalMSatSent: c.TotalMSatSent, TotalMSatReceived: c.T...
[ "func", "(", "c", "*", "OpenChannel", ")", "Snapshot", "(", ")", "*", "ChannelSnapshot", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n\n", "localCommit", ":=", "c", ".", "LocalCommitment", "\n", "snapshot", ":=", ...
// Snapshot returns a read-only snapshot of the current channel state. This // snapshot includes information concerning the current settled balance within // the channel, metadata detailing total flows, and any outstanding HTLCs.
[ "Snapshot", "returns", "a", "read", "-", "only", "snapshot", "of", "the", "current", "channel", "state", ".", "This", "snapshot", "includes", "information", "concerning", "the", "current", "settled", "balance", "within", "the", "channel", "metadata", "detailing", ...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L2151-L2179
128,997
lightningnetwork/lnd
channeldb/channel.go
RemoteRevocationStore
func (c *OpenChannel) RemoteRevocationStore() (shachain.Store, error) { err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } return fetchChanRevocationState(chanBucket, c) }) if err != nil {...
go
func (c *OpenChannel) RemoteRevocationStore() (shachain.Store, error) { err := c.Db.View(func(tx *bbolt.Tx) error { chanBucket, err := fetchChanBucket( tx, c.IdentityPub, &c.FundingOutpoint, c.ChainHash, ) if err != nil { return err } return fetchChanRevocationState(chanBucket, c) }) if err != nil {...
[ "func", "(", "c", "*", "OpenChannel", ")", "RemoteRevocationStore", "(", ")", "(", "shachain", ".", "Store", ",", "error", ")", "{", "err", ":=", "c", ".", "Db", ".", "View", "(", "func", "(", "tx", "*", "bbolt", ".", "Tx", ")", "error", "{", "ch...
// RemoteRevocationStore returns the most up to date commitment version of the // revocation storage tree for the remote party. This method can be used when // acting on a possible contract breach to ensure, that the caller has the most // up to date information required to deliver justice.
[ "RemoteRevocationStore", "returns", "the", "most", "up", "to", "date", "commitment", "version", "of", "the", "revocation", "storage", "tree", "for", "the", "remote", "party", ".", "This", "method", "can", "be", "used", "when", "acting", "on", "a", "possible", ...
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L2207-L2223
128,998
lightningnetwork/lnd
channeldb/channel.go
makeLogKey
func makeLogKey(updateNum uint64) [8]byte { var key [8]byte byteOrder.PutUint64(key[:], updateNum) return key }
go
func makeLogKey(updateNum uint64) [8]byte { var key [8]byte byteOrder.PutUint64(key[:], updateNum) return key }
[ "func", "makeLogKey", "(", "updateNum", "uint64", ")", "[", "8", "]", "byte", "{", "var", "key", "[", "8", "]", "byte", "\n", "byteOrder", ".", "PutUint64", "(", "key", "[", ":", "]", ",", "updateNum", ")", "\n", "return", "key", "\n", "}" ]
// makeLogKey converts a uint64 into an 8 byte array.
[ "makeLogKey", "converts", "a", "uint64", "into", "an", "8", "byte", "array", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/channeldb/channel.go#L2679-L2683
128,999
lightningnetwork/lnd
watchtower/wtmock/peer.go
NewMockPeer
func NewMockPeer(lpk, rpk *btcec.PublicKey, addr net.Addr, bufferSize int) *MockPeer { return &MockPeer{ remotePub: rpk, remoteAddr: addr, localAddr: &net.TCPAddr{ IP: net.IP{0x32, 0x31, 0x30, 0x29}, Port: 36723, }, localPub: lpk, IncomingMsgs: make(chan []byte, bufferSize), OutgoingMsgs: ...
go
func NewMockPeer(lpk, rpk *btcec.PublicKey, addr net.Addr, bufferSize int) *MockPeer { return &MockPeer{ remotePub: rpk, remoteAddr: addr, localAddr: &net.TCPAddr{ IP: net.IP{0x32, 0x31, 0x30, 0x29}, Port: 36723, }, localPub: lpk, IncomingMsgs: make(chan []byte, bufferSize), OutgoingMsgs: ...
[ "func", "NewMockPeer", "(", "lpk", ",", "rpk", "*", "btcec", ".", "PublicKey", ",", "addr", "net", ".", "Addr", ",", "bufferSize", "int", ")", "*", "MockPeer", "{", "return", "&", "MockPeer", "{", "remotePub", ":", "rpk", ",", "remoteAddr", ":", "addr"...
// NewMockPeer returns a fresh MockPeer.
[ "NewMockPeer", "returns", "a", "fresh", "MockPeer", "." ]
1acd38e48c168b86c291524eb56b8fcdf04a910c
https://github.com/lightningnetwork/lnd/blob/1acd38e48c168b86c291524eb56b8fcdf04a910c/watchtower/wtmock/peer.go#L30-L45