Browse Source

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.
travis-test
Christian Decker 5 years ago
parent
commit
014ab37338
  1. 6
      plugins/libplugin-pay.c

6
plugins/libplugin-pay.c

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

Loading…
Cancel
Save