mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-24 08:34:18 +01:00
rebalance: listpays use status argument
It is a performance improvement: `rebalancereport` running time changes from 40 secs to 14 secs on my node.
This commit is contained in:
committed by
Michael Schmoock
parent
e625369423
commit
ce423836d6
@@ -761,10 +761,7 @@ def rebalancereport(plugin: Plugin):
|
||||
total_fee = Millisatoshi(0)
|
||||
total_amount = Millisatoshi(0)
|
||||
res["total_successful_rebalances"] = len(rebalances)
|
||||
# pyln-client does not support the 'status' argument as yet
|
||||
# pays = plugin.rpc.listpays(status="complete")["pays"]
|
||||
pays = plugin.rpc.listpays()["pays"]
|
||||
pays = [p for p in pays if p.get('status') == 'complete']
|
||||
pays = plugin.rpc.listpays(status="complete")["pays"]
|
||||
for r in rebalances:
|
||||
try:
|
||||
pay = next(p for p in pays if p["payment_hash"] == r["payment_hash"])
|
||||
|
||||
Reference in New Issue
Block a user