pickhardtpayments icon indicating copy to clipboard operation
pickhardtpayments copied to clipboard

_dissect_flow_to_paths skips flow on parallel channels

Open sebulino opened this issue 2 years ago • 0 comments

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())

sebulino avatar Jan 30 '23 13:01 sebulino