paymod: Add a bit more information to the `pay` response

Amount, parent_part_id  and own partid can be helpful when debugging.
This commit is contained in:
Christian Decker 2020-07-12 14:30:49 +02:00 committed by Rusty Russell
parent 6f40cb0202
commit 9be4d552fa
1 changed files with 5 additions and 0 deletions

View File

@ -1015,6 +1015,11 @@ static void payment_add_attempt(struct json_stream *s, const char *fieldname, st
if (p->failreason != NULL)
json_add_string(s, "failreason", p->failreason);
json_add_u64(s, "partid", p->partid);
json_add_amount_msat_only(s, "amount", p->amount);
if (p->parent != NULL)
json_add_u64(s, "parent_partid", p->parent->partid);
json_object_end(s);
for (size_t i=0; i<tal_count(p->children); i++) {
payment_add_attempt(s, fieldname, p->children[i], recurse);