addPeer
Add (or merge) a peer learned for (host, port) from source. This is the port of the IP path of peer_list::add_peer. Returns the stored TorrentPeer (existing or freshly created), or null if the endpoint is rejected.
Faithful behaviours:
invalid endpoints are ignored: port 0 or 1, and IPv6 link-local addresses (which need a scope to be usable);
dedupe: if we already know this endpoint we update the existing record (updatePeer) instead of inserting a duplicate, and set TorrentState.firstTimeSeen to false; a brand-new peer sets it true;
the new peer is created connectable (we have a port for it) with the given source and any pexFlags hints folded in.
Parameters
literal IP or hostname. A literal IP enables address-keyed dedupe; a non-literal host is deduped by exact host:port.
the peer's port in [0, 65535].
one of the PeerSource flags.
optional PexFlags hints (seed/utp/holepunch/…).
torrent context; TorrentState.firstTimeSeen is written.