renepickhardt / pickhardtpayments

python package to showcase, test and build your own version of Pickhardt Payments
Apache License 2.0
42 stars 14 forks source link

probabilities in UncertaintyGraph #25

Open sebulino opened 2 years ago

sebulino commented 2 years ago

When and how do we handle the amounts the best way?

This is an extract from https://github.com/renepickhardt/pickhardtpayments/pull/24#discussion_r878517534 and https://github.com/renepickhardt/pickhardtpayments/pull/24#discussion_r884080910

When doing a try loop on a (partial) payments, the amount is allotted to the path and in the UncertaintyGraph this is considered for the calculation of the success probabilities.

while internally I increase the inflight counter I am actually in the planning phase and to compute the probabilities of planned paths I need to take into account that I already plan to allocate something sats to an edge (without knowing if that will work yet) So maybe we just need to move over the logic from the Enum to the state of a channel where we also have planned sats before we go and send onions and switch those to inflight sats. in this way I would note have to remove them before testing onions. does that make any sense? I am actually not sure myself if this would be any good.