paymod: Iterate through the routehints in order

We store an offset of the current routehint in the modifier data. It gets
incremented on retry, and it gets reset to 0 on split. This is because once we
split we have a different amount and a previously unusable routehint becomes
usable again.
This commit is contained in:
Christian Decker
2020-07-23 11:43:11 +02:00
parent 1e28d661fd
commit 56dd18e01e
2 changed files with 14 additions and 4 deletions

View File

@@ -296,6 +296,11 @@ struct routehints_data {
/* Current routehint, if any. */
struct route_info *current_routehint;
/* Position of the current routehint in the routehints
* array. Inherited and incremented on child payments and reset on
* split. */
int offset;
/* We modify the CLTV in the getroute call, so we need to remember
* what the final cltv delta was so we re-apply it correctly. */
u32 final_cltv;