mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-18 22:34:22 +01:00
easy node id lookup
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
type Node struct {
|
||||
NodeId []byte
|
||||
Client lightning.Client
|
||||
NodeConfig *config.NodeConfig
|
||||
PrivateKey *btcec.PrivateKey
|
||||
|
||||
6
main.go
6
main.go
@@ -304,6 +304,12 @@ func initializeNodes(configs []*config.NodeConfig) ([]*common.Node, error) {
|
||||
node.NodeConfig.NodePubkey = info.Pubkey
|
||||
}
|
||||
|
||||
nodeId, err := hex.DecodeString(info.Pubkey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse node id %s", info.Pubkey)
|
||||
}
|
||||
|
||||
node.NodeId = nodeId
|
||||
node.Tokens = config.Tokens
|
||||
nodes = append(nodes, node)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user