From 799eb515283ce9fccea68d3207edbfda254bbddf Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Mon, 29 Apr 2019 23:54:26 +0200 Subject: [PATCH] fix: workaround for outdated pylightning versions #2601 --- rebalance/rebalance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rebalance/rebalance.py b/rebalance/rebalance.py index 2220892..5ca6ca0 100755 --- a/rebalance/rebalance.py +++ b/rebalance/rebalance.py @@ -154,7 +154,8 @@ def rebalance(plugin, outgoing_scid, incoming_scid, msatoshi: Millisatoshi=None, route = [route_out] + route_mid + [route_in] setup_routing_fees(plugin, route, msatoshi) fees = route[0]['msatoshi'] - route[-1]['msatoshi'] - if fees > exemptfee and fees > msatoshi * float(maxfeepercent) / 100: + # NOTE: the int(msat) casts are just a workaround for outdated pylightning versions + if fees > exemptfee and int(fees) > int(msatoshi) * float(maxfeepercent) / 100: worst_channel_id = find_worst_channel(route) if worst_channel_id is None: raise RpcError("rebalance", payload, {'message': 'Insufficient fee'})