pickhardtpayments
pickhardtpayments copied to clipboard
_dissect_flow_to_paths skips flow on parallel channels
Flow is not added to an edge if placed on a parallel edge with a short_channel_id that is not yet in the MultiGraph.
if G.has_edge(src, dest):
if channel.short_channel_id in G[src][dest]:
G[src][dest][channel.short_channel_id]["flow"] += flow
else:
G.add_edge(src, dest, key=channel.short_channel_id, flow=flow,
channel=channel, weight=channel.combined_linearized_unit_cost())
should be
if G.has_edge(src, dest) and (channel.short_channel_id in G[src][dest]):
G[src][dest][channel.short_channel_id]["flow"] += flow
else:
G.add_edge(src, dest, key=channel.short_channel_id, flow=flow,
channel=channel, weight=channel.combined_linearized_unit_cost())