mirror of
https://github.com/aljazceru/plugins.git
synced 2026-01-20 13:34:25 +01:00
drain: get cltv-final from lightningd instead of own option
This commit is contained in:
@@ -20,7 +20,7 @@ HTLC_FEE_PAT = re.compile("^.* HTLC fee: ([0-9]+sat).*$")
|
|||||||
|
|
||||||
|
|
||||||
def setup_routing_fees(plugin, payload, route, amount, substractfees: bool = False):
|
def setup_routing_fees(plugin, payload, route, amount, substractfees: bool = False):
|
||||||
delay = int(plugin.get_option('cltv-final'))
|
delay = plugin.cltv_final
|
||||||
|
|
||||||
amount_iter = amount
|
amount_iter = amount
|
||||||
for r in reversed(route):
|
for r in reversed(route):
|
||||||
@@ -474,9 +474,10 @@ def setbalance(plugin, scid: str, percentage: float = 50, chunks: int = 0, retry
|
|||||||
|
|
||||||
@plugin.init()
|
@plugin.init()
|
||||||
def init(options, configuration, plugin):
|
def init(options, configuration, plugin):
|
||||||
plugin.options['cltv-final']['value'] = plugin.rpc.listconfigs().get('cltv-final')
|
plugin.getinfo = plugin.rpc.getinfo()
|
||||||
|
plugin.configs = plugin.rpc.listconfigs()
|
||||||
|
plugin.cltv_final = plugin.configs.get('cltv-final')
|
||||||
plugin.log("Plugin drain.py initialized")
|
plugin.log("Plugin drain.py initialized")
|
||||||
|
|
||||||
|
|
||||||
plugin.add_option('cltv-final', 10, 'Number of blocks for final CheckLockTimeVerify expiry')
|
|
||||||
plugin.run()
|
plugin.run()
|
||||||
|
|||||||
Reference in New Issue
Block a user