public NetworkAddressWithTime With(UInt32? Time = null, NetworkAddress NetworkAddress = null)
 {
     return new NetworkAddressWithTime
     (
         Time ?? this.Time,
         NetworkAddress ?? this.NetworkAddress
     );
 }
Пример #2
0
 public VersionPayload(UInt32 ProtocolVersion, UInt64 ServicesBitfield, DateTimeOffset Time, NetworkAddress RemoteAddress, NetworkAddress LocalAddress, UInt64 Nonce, string UserAgent, UInt32 StartBlockHeight, bool Relay)
 {
     this.ProtocolVersion = ProtocolVersion;
     this.ServicesBitfield = ServicesBitfield;
     this.Time = Time;
     this.RemoteAddress = RemoteAddress;
     this.LocalAddress = LocalAddress;
     this.Nonce = Nonce;
     this.UserAgent = UserAgent;
     this.StartBlockHeight = StartBlockHeight;
     this.Relay = Relay;
 }
Пример #3
0
 public VersionPayload With(UInt32? ProtocolVersion = null, UInt64? ServicesBitfield = null, DateTimeOffset? Time = null, NetworkAddress RemoteAddress = null, NetworkAddress LocalAddress = null, UInt64? Nonce = null, string UserAgent = null, UInt32? StartBlockHeight = null, bool? Relay = null)
 {
     return new VersionPayload
     (
         ProtocolVersion ?? this.ProtocolVersion,
         ServicesBitfield ?? this.ServicesBitfield,
         Time ?? this.Time,
         RemoteAddress ?? this.RemoteAddress,
         LocalAddress ?? this.LocalAddress,
         Nonce ?? this.Nonce,
         UserAgent ?? this.UserAgent,
         StartBlockHeight ?? this.StartBlockHeight,
         Relay ?? this.Relay
     );
 }
Пример #4
0
 public static byte[] EncodeNetworkAddress(NetworkAddress networkAddress)
 {
     using (var stream = new MemoryStream())
     using (var writer = new BinaryWriter(stream))
     {
         EncodeNetworkAddress(writer, networkAddress);
         return stream.ToArray();
     }
 }
Пример #5
0
 public static void EncodeNetworkAddress(BinaryWriter writer, NetworkAddress networkAddress)
 {
     writer.WriteUInt64(networkAddress.Services);
     writer.WriteBytes(16, networkAddress.IPv6Address.ToArray());
     writer.WriteUInt16BE(networkAddress.Port);
 }
Пример #6
0
 public VersionPayload With(UInt32?ProtocolVersion = null, UInt64?ServicesBitfield = null, UInt64?UnixTime = null, NetworkAddress RemoteAddress = null, NetworkAddress LocalAddress = null, UInt64?Nonce = null, string UserAgent = null, UInt32?StartBlockHeight = null, bool?Relay = null)
 {
     return(new VersionPayload
            (
                ProtocolVersion ?? this.ProtocolVersion,
                ServicesBitfield ?? this.ServicesBitfield,
                UnixTime ?? this.UnixTime,
                RemoteAddress ?? this.RemoteAddress,
                LocalAddress ?? this.LocalAddress,
                Nonce ?? this.Nonce,
                UserAgent ?? this.UserAgent,
                StartBlockHeight ?? this.StartBlockHeight,
                Relay ?? this.Relay
            ));
 }
Пример #7
0
 public VersionPayload(UInt32 ProtocolVersion, UInt64 ServicesBitfield, UInt64 UnixTime, NetworkAddress RemoteAddress, NetworkAddress LocalAddress, UInt64 Nonce, string UserAgent, UInt32 StartBlockHeight, bool Relay)
 {
     this.ProtocolVersion  = ProtocolVersion;
     this.ServicesBitfield = ServicesBitfield;
     this.UnixTime         = UnixTime;
     this.RemoteAddress    = RemoteAddress;
     this.LocalAddress     = LocalAddress;
     this.Nonce            = Nonce;
     this.UserAgent        = UserAgent;
     this.StartBlockHeight = StartBlockHeight;
     this.Relay            = Relay;
 }
 public NetworkAddressWithTime(UInt32 Time, NetworkAddress NetworkAddress)
 {
     this.Time = Time;
     this.NetworkAddress = NetworkAddress;
 }
Пример #9
0
 public NetworkAddressWithTime(UInt32 Time, NetworkAddress NetworkAddress)
 {
     this.Time           = Time;
     this.NetworkAddress = NetworkAddress;
 }