mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
connected_hook: allow hook to specify an error message.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
a314bc62fc
commit
7f7ad4f89f
@@ -16,7 +16,7 @@ plugin = Plugin()
|
||||
def on_connected(peer, plugin):
|
||||
if peer['id'] in plugin.reject_ids:
|
||||
print("{} is in reject list, disconnecting".format(peer['id']))
|
||||
return {'result': 'disconnect'}
|
||||
return {'result': 'disconnect', 'error_message': 'You are in reject list'}
|
||||
|
||||
print("{} is allowed".format(peer['id']))
|
||||
return {'result': 'continue'}
|
||||
|
||||
Reference in New Issue
Block a user