mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
paymod: Do not duplicate partids
When using mpp we need to always have partids>0, since we bumped the partid for the root, but not the next_id we'd end up with partid=1 being duplicated. Not a big problem since we never ended up sending the root to lightningd, instead skipping it, but it was confusing me while trying to trace sub-payment's ancestry.
This commit is contained in:
committed by
Rusty Russell
parent
7b4e70effa
commit
cb20dfc59e
@@ -2217,6 +2217,12 @@ static void presplit_cb(struct presplit_mod_data *d, struct payment *p)
|
||||
* value. */
|
||||
root->partid++;
|
||||
|
||||
/* Bump the next_partid as well so we don't have duplicate
|
||||
* partids. Not really necessary since the root payment whose
|
||||
* id could be reused will never reach the `sendonion` step,
|
||||
* but makes debugging a bit easier. */
|
||||
root->next_partid++;
|
||||
|
||||
/* If we are already below the target size don't split it
|
||||
* either. */
|
||||
if (amount_msat_greater(MPP_TARGET_MSAT, p->amount))
|
||||
|
||||
Reference in New Issue
Block a user