Add plugin notification topic "block_processed".

Changelog-Added: Plugins: Added notification topic "block_processed".
This commit is contained in:
fiatjaf
2022-09-09 09:48:31 -03:00
committed by neil saitug
parent 112115022c
commit 9b33a921f0
6 changed files with 105 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
from pyln.client import Plugin
plugin = Plugin()
blocks_catched = []
@plugin.subscribe("block_processed")
def notify_block_processed(plugin, block, **kwargs):
global blocks_catched
blocks_catched.append(block["height"])
@plugin.method("blockscatched")
def return_moves(plugin):
return blocks_catched
plugin.run()