Ejemplo n.º 1
0
        public static NetworkNode Create(NodeAnnouncementMessage message)
        {
            NetworkNode networkNode = new NetworkNode();

            networkNode.Id            = message.NodeIdHex;
            networkNode.CreatedEntity = DateTime.Now;
            return(networkNode.Update(message));
        }
Ejemplo n.º 2
0
        public static NetworkNode Create(string nodeId)
        {
            NetworkNode networkNode = new NetworkNode();

            networkNode.Id            = nodeId;
            networkNode.CreatedEntity = DateTime.Now;
            networkNode.Timestamp     = DateTime.Now;
            networkNode.LastUpdated   = DateTime.Now;

            return(networkNode);
        }
Ejemplo n.º 3
0
        public static NetworkChannel Create(ChannelAnnouncementMessage announcement, ChannelUpdateMessage update, NetworkNode node1, NetworkNode node2)
        {
            NetworkChannel networkChannel = new NetworkChannel();

            networkChannel.CreatedEntity     = DateTime.Now;
            networkChannel.Id                = announcement.ShortChannelIdHex;
            networkChannel.Node1             = node1;
            networkChannel.Node2             = node2;
            networkChannel.Node1Id           = node1.Id;
            networkChannel.Node2Id           = node2.Id;
            networkChannel.ChannelShortId    = announcement.ShortChannelId;
            networkChannel.Features          = announcement.Features;
            networkChannel.ChainHash         = announcement.ChainHash;
            networkChannel.NodeSignature1    = announcement.NodeSignature1;
            networkChannel.NodeSignature2    = announcement.NodeSignature2;
            networkChannel.BitcoinSignature1 = announcement.BitcoinSignature1;
            networkChannel.BitcoinSignature2 = announcement.BitcoinSignature2;
            networkChannel.BitcoinKey1       = announcement.BitcoinKey1.PublicKeyCompressed;
            networkChannel.BitcoinKey2       = announcement.BitcoinKey2.PublicKeyCompressed;

            if (update != null)
            {
                networkChannel.Update(update);
            }

            return(networkChannel);
        }