From 89c95e4fe8ed86a284c5e07b37106a21a4d5423d Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Mon, 20 May 2019 19:34:08 +0200 Subject: [PATCH] rebalance: fix issue 29 I think this issue happens on older version of pylightning only. --- rebalance/rebalance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rebalance/rebalance.py b/rebalance/rebalance.py index cd9084a..769648c 100755 --- a/rebalance/rebalance.py +++ b/rebalance/rebalance.py @@ -85,8 +85,8 @@ def calc_optimal_amount(out_ours, out_total, in_ours, in_total, payload): in_ours, in_total = int(in_ours), int(in_total) in_theirs = in_total - in_ours - vo = out_ours - (out_total/2) - vi = (in_total/2) - in_ours + vo = int(out_ours - (out_total/2)) + vi = int((in_total/2) - in_ours) # cases where one option can be eliminated because it exceeds other capacity if vo > in_theirs and vi > 0 and vi < out_ours: