@@ -419,8 +419,7 @@ static void add_new_entry(struct json_stream *ret,
419419 json_add_u64 (ret , "number_of_parts" ,
420420 pm -> num_nonfailed_parts );
421421
422- if (pm -> created_index )
423- json_add_u64 (ret , "created_index" , pm -> created_index );
422+ json_add_u64 (ret , "created_index" , pm -> created_index );
424423
425424 if (pm -> updated_index )
426425 json_add_u64 (ret , "updated_index" , pm -> updated_index );
@@ -527,6 +526,15 @@ static struct command_result *listsendpays_done(struct command *cmd,
527526 pm -> invstring = tal_steal (pm , invstr );
528527 if (!pm -> description )
529528 pm -> description = json_get_member (buf , t , "description" );
529+ /* What's the "created_index" of the merged record?
530+ * We take the *lowest*, since that will never change
531+ * (unless they delete payments!). */
532+ if (created_index < pm -> created_index )
533+ pm -> created_index = created_index ;
534+ /* On the other hand, we take the *highest*
535+ * updated_index, so we see any changes. */
536+ if (updated_index > pm -> updated_index )
537+ pm -> updated_index = updated_index ;
530538 }
531539
532540 status = json_get_member (buf , t , "status" );
0 commit comments