mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
28 lines
566 B
Python
Executable File
28 lines
566 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Use the openchannel hook to selectively opt-into zeroconf
|
|
"""
|
|
|
|
from pyln.client import Plugin
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.hook('openchannel')
|
|
def on_openchannel(openchannel, plugin, **kwargs):
|
|
plugin.log(repr(openchannel))
|
|
reserve = plugin.options['reserve']['value']
|
|
|
|
if reserve is None:
|
|
return {'result': 'continue'}
|
|
else:
|
|
return {'result': 'continue', 'reserve': reserve}
|
|
|
|
|
|
plugin.add_option(
|
|
'reserve',
|
|
None,
|
|
'Absolute reserve to require from peers when accepting channels',
|
|
)
|
|
|
|
plugin.run()
|