lightningd/plugin_hook.c: Make db_write a chained hook.

Fixes: #4219

Changelog-Changed: Plugins: Multiple plugins can now register `db_write` hooks.
This commit is contained in:
ZmnSCPxj jxPCSnmZ
2020-11-23 13:05:56 +08:00
committed by Rusty Russell
parent 904e110554
commit 32de621886
4 changed files with 105 additions and 24 deletions

16
tests/plugins/dbdummy.py Executable file
View File

@@ -0,0 +1,16 @@
#! /usr/bin/env python3
'''This plugin is a do-nothing backup plugin which just checks that we
can handle multiple backup plugins.
'''
from pyln.client import Plugin
plugin = Plugin()
@plugin.hook('db_write')
def db_write(plugin, **kwargs):
return {'result': 'continue'}
plugin.run()