Table of Contents

Class PeerAddress

Namespace
NLightning.Infrastructure.Protocol.Models
Assembly
NLightning.Infrastructure.dll

Represents a peer address.

public sealed class PeerAddress : IEquatable<PeerAddress>
Inheritance
PeerAddress
Implements
Inherited Members

Constructors

PeerAddress(CompactPubKey, string)

Initializes a new instance of the PeerAddress class.

public PeerAddress(CompactPubKey pubKey, string address)

Parameters

pubKey CompactPubKey

The public key.

address string

The address.

Remarks

The address is in the format of "http://host:port" or "host:port".

PeerAddress(CompactPubKey, string, int)

Initializes a new instance of the PeerAddress class.

public PeerAddress(CompactPubKey pubKey, string host, int port)

Parameters

pubKey CompactPubKey

The public key.

host string

The host.

port int

The port.

PeerAddress(PeerAddressInfo)

public PeerAddress(PeerAddressInfo peerAddressInfo)

Parameters

peerAddressInfo PeerAddressInfo

PeerAddress(string)

Initializes a new instance of the PeerAddress class.

public PeerAddress(string address)

Parameters

address string

The address.

Remarks

The address is in the format of "pubkey@host:port".

Properties

Host

Gets the host.

public IPAddress Host { get; }

Property Value

IPAddress

Port

Gets the port.

public int Port { get; }

Property Value

int

PubKey

Gets the public key.

public CompactPubKey PubKey { get; }

Property Value

CompactPubKey

Methods

Equals(PeerAddress?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PeerAddress? other)

Parameters

other PeerAddress

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the address.

public override string ToString()

Returns

string

A string in the format of "pubkey@host:port".