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

Function on_connected

tests/plugins/peer_connected_logger_a.py:14–20  ·  view source on GitHub ↗
(peer, plugin, **kwargs)

Source from the content-addressed store, hash-verified

12
13@plugin.hook('peer_connected')
14def on_connected(peer, plugin, **kwargs):
15 print(f"peer_connected_logger_a {peer['id']} {peer}")
16 if plugin.get_option("logger_a_sleep") is True:
17 # Block until file appears
18 while not os.path.exists("unsleep"):
19 time.sleep(0.25)
20 return {'result': 'continue'}
21
22
23plugin.add_option("logger_a_sleep", False, 'Block until unsleep file exists', opt_type='bool')

Callers

nothing calls this directly

Calls 1

get_optionMethod · 0.80

Tested by

no test coverage detected