EvtLocalAddressesUpdated class
EvtLocalAddressesUpdated should be emitted when the set of listen addresses for the local host changes. This may happen for a number of reasons. For example, we may have opened a new relay connection, established a new NAT mapping via UPnP, or been informed of our observed address by another peer.
EvtLocalAddressesUpdated contains a snapshot of the current listen addresses, and may also contain a diff between the current state and the previous state. If the event producer is capable of creating a diff, the Diffs field will be true, and event consumers can inspect the Action field of each UpdatedAddress to see how each address was modified.
For example, the Action will tell you whether an address in the Current list was Added by the event producer, or was Maintained without changes. Addresses that were removed from the Host will have the AddrAction of Removed, and will be in the Removed list.
If the event producer is not capable or producing diffs, the Diffs field will be false, the Removed list will always be empty, and the Action for each UpdatedAddress in the Current list will be Unknown.
In addition to the above, EvtLocalAddressesUpdated also contains the updated peer.PeerRecord for the Current set of listen addresses, wrapped in a record.Envelope and signed by the Host's private key. This record can be shared with other peers to inform them of what we believe are our diallable addresses a secure and authenticated way.
Constructors
-
EvtLocalAddressesUpdated.new({required bool diffs, required List<
UpdatedAddress> current, List<UpdatedAddress> removed = const [], dynamic signedPeerRecord}) - Creates a new EvtLocalAddressesUpdated event.
Properties
-
current
→ List<
UpdatedAddress> -
Current contains all current listen addresses for the Host.
If Diffs == true, the Action field of each UpdatedAddress will tell
you whether an address was Added, or was Maintained from the previous
state.
final
- diffs → bool
-
Diffs indicates whether this event contains a diff of the Host's previous
address set.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
removed
→ List<
UpdatedAddress> -
Removed contains addresses that were removed from the Host.
This field is only set when Diffs == true.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signedPeerRecord → dynamic
-
SignedPeerRecord contains our own updated peer.PeerRecord, listing the addresses enumerated in Current,
wrapped in a record.Envelope and signed by the Host's private key.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited