home | help
LIGHTNING-HOOK-PEER_CONNECTED(7)		LIGHTNING-HOOK-PEER_CONNECTED(7)

NAME
     peer_connected -- Hook fired when a peer connects and completes handshake

DESCRIPTION
     The  peer_connected  hook	is called whenever a peer has connected and suc-
     cessfully completed the cryptographic handshake.

     This is a chained hook: the first plugin returning "disconnect" stops  fur-
     ther  processing.	Plugins can call listpeers to retrieve additional infor-
     mation about the peer.

HOOK PAYLOAD
     *	peer (object):
	*  id (pubkey): The node_id of the connected peer.
	*  direction (string) (one of "in", "out"): Connection direction: in for
	   incoming, out for outgoing.
	*  addr (string): The addr field shows the address that we are connected
	   to ourselves, not the gossiped list of known addresses.  In	particu-
	   lar this means that the port for incoming connections is an ephemeral
	   port, that may not be available for reconnections.
	*  features (hex): Feature bits advertised by the peer, encoded as hex.
	*  remote_addr	(string,  optional):  Our own address as reported by the
	   remote peer. Helps with detecting our own IPv4 changes behind NAT.

HOOK RETURN
     *	result (string) (one of "continue", "disconnect"): Whether to allow  the
	connection to proceed or disconnect the peer.
     *	error_message  (string,  optional):  Optional  error message sent to the
	peer before disconnection.  Only used if result is "disconnect".

SEE ALSO
     lightning-listpeers(7)

Core Lightning v26.06.1 			LIGHTNING-HOOK-PEER_CONNECTED(7)

home | help