You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
416 B
20 lines
416 B
#!/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.run()
|
|
|