diff --git a/common/nodes_service.go b/common/nodes_service.go index e983c3c..df78b15 100644 --- a/common/nodes_service.go +++ b/common/nodes_service.go @@ -12,6 +12,7 @@ import ( ) type Node struct { + NodeId []byte Client lightning.Client NodeConfig *config.NodeConfig PrivateKey *btcec.PrivateKey diff --git a/main.go b/main.go index 91e85b7..8e86e5a 100644 --- a/main.go +++ b/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) }