mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
0e753224ae
These are now included in all builds
28 lines
606 B
Python
Executable File
28 lines
606 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Plugin to test openchannel_hook
|
|
|
|
Will simply reject any channel with message "reject on principle".
|
|
Useful fot testing chained hook.
|
|
"""
|
|
|
|
from pyln.client import Plugin
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.hook('openchannel')
|
|
def on_openchannel(openchannel, plugin, **kwargs):
|
|
msg = "reject on principle"
|
|
plugin.log(msg)
|
|
return {'result': 'reject', 'error_message': msg}
|
|
|
|
|
|
@plugin.hook('openchannel2')
|
|
def on_openchannel2(openchannel2, plugin, **kwargs):
|
|
msg = "reject on principle"
|
|
plugin.log(msg)
|
|
return {'result': 'reject', 'error_message': msg}
|
|
|
|
|
|
plugin.run()
|