MCPcopy Create free account
hub / github.com/ElementsProject/lightning / on_connected

Function on_connected

tests/plugins/reject.py:16–22  ·  view source on GitHub ↗
(peer, plugin, **kwargs)

Source from the content-addressed store, hash-verified

14
15@plugin.hook('peer_connected')
16def on_connected(peer, plugin, **kwargs):
17 if peer['id'] in plugin.reject_ids:
18 print("{} is in reject list, disconnecting".format(peer['id']))
19 return {'result': 'disconnect', 'error_message': 'You are in reject list'}
20
21 print("{} is allowed".format(peer['id']))
22 return {'result': 'continue'}
23
24
25@plugin.init()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected