mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-24 08:34:18 +01:00
rebalance: fix route direction
This will set the correct `direction` on manual route hops (in/out). Before this was not set, resulting in WIRE_FEE_INSUFFICIENT errors, if fee was calcualted inconsistently with `direction`.
This commit is contained in:
committed by
Christian Decker
parent
300b963c9d
commit
cd1b751f53
@@ -157,8 +157,8 @@ def rebalance(plugin, outgoing_scid, incoming_scid, msatoshi: Millisatoshi=None,
|
||||
if msatoshi > out_ours or msatoshi > in_total - in_ours:
|
||||
raise RpcError("rebalance", payload, {'message': 'Channel capacities too low'})
|
||||
|
||||
route_out = {'id': outgoing_node_id, 'channel': outgoing_scid}
|
||||
route_in = {'id': my_node_id, 'channel': incoming_scid}
|
||||
route_out = {'id': outgoing_node_id, 'channel': outgoing_scid, 'direction': int(not my_node_id < outgoing_node_id)}
|
||||
route_in = {'id': my_node_id, 'channel': incoming_scid, 'direction': int(not incoming_node_id < my_node_id)}
|
||||
start_ts = int(time.time())
|
||||
label = "Rebalance-" + str(uuid.uuid4())
|
||||
description = "%s to %s" % (outgoing_scid, incoming_scid)
|
||||
|
||||
Reference in New Issue
Block a user