plugin:added invoice creation event

New invoice_creation event triggered when an new invoice is created

Changelog-Added: plugin: New invoice_creation plugin event
This commit is contained in:
rbndg
2020-04-21 11:04:01 +10:00
committed by Christian Decker
parent 84ef0cf7fa
commit 241fa00e97
7 changed files with 85 additions and 0 deletions

View File

@@ -48,6 +48,14 @@ def on_payment(plugin, invoice_payment, **kwargs):
invoice_payment.get("msat")))
@plugin.subscribe("invoice_creation")
def on_invoice_creation(plugin, invoice_creation, **kwargs):
plugin.log("Received invoice_creation event for label {}, preimage {},"
" and amount of {}".format(invoice_creation.get("label"),
invoice_creation.get("preimage"),
invoice_creation.get("msat")))
@plugin.hook("htlc_accepted")
def on_htlc_accepted(onion, htlc, plugin, **kwargs):
plugin.log('on_htlc_accepted called')