ExtensionHandshake
object ExtensionHandshake
The BEP-10 extension-protocol handshake: the bencoded dict exchanged as extended message id 0 right after the BitTorrent handshake (when the extension reserved bit is set). Port of libtorrent's bt_peer_connection::write_extensions / parse_extensions.
The m dict maps extension names → the message id the sender wants the peer to use when sending it that extension. So when we receive a peer's handshake, m["ut_metadata"] is the id WE must put on extended messages we send them; the ids in build are the ones we ask them to use toward us.