removePeerAddress method

void removePeerAddress(
  1. PeerId peerId
)
inherited

Removes the peer address from the routing table.

This method removes the peer address from the routing table. If the peer is removed from the routing table, the last seen controller is updated to indicate that the peer is offline.

The peerId parameter specifies the ID of the peer to remove.

Implementation

void removePeerAddress(PeerId peerId) {
  // Remove the peer from the routing table.
  if (routes.remove(peerId) != null) {
    // Update the last seen controller to indicate that the peer is
    // offline.
    _lastSeenController.add((peerId: peerId, isOnline: false));
  }
}