mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
Add plugin notification topic "block_processed".
Changelog-Added: Plugins: Added notification topic "block_processed".
This commit is contained in:
22
tests/plugins/block_processed.py
Executable file
22
tests/plugins/block_processed.py
Executable 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()
|
||||
Reference in New Issue
Block a user