tuweni / org.apache.tuweni.devp2p / Peer / updateEndpoint

updateEndpoint

abstract fun updateEndpoint(endpoint: Endpoint, time: Long, ifVerifiedBefore: Long? = null): Endpoint (source)

Update the peer with a new endpoint.

If successful, the endpoint property will be set, the lastSeen timestamp will be updated. If the IP address or UDP port of the endpoint was changed, then the lastVerified timestamp will be cleared.

Parameters

endpoint - the endpoint for the peer

time - the time this endpoint information was determined, in milliseconds since the epoch

ifVerifiedBefore - the latest allowable time, in milliseconds since the epoch, when this peer was last verified at its current endpoint. If this peers endpoint was verified after this time, the endpoint will not be updated. If null, then no check will be made and the endpoint will always be updated.

Return
the resulting endpoint of the peer