From 3c39bcc0f7d1a654170508c91bf6d31ecd189724 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Wed, 14 Mar 2018 11:12:18 +0000 Subject: [PATCH] pay: Make json_add_payment_fields accessible to other parts. --- lightningd/pay.c | 2 +- lightningd/pay.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lightningd/pay.c b/lightningd/pay.c index 6a2669771..c7d1c2dbe 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -803,7 +803,7 @@ Utility -----------------------------------------------------------------------------*/ /* Outputs fields, not a separate object*/ -static void +void json_add_payment_fields(struct json_result *response, const struct wallet_payment *t) { diff --git a/lightningd/pay.h b/lightningd/pay.h index a98f9d375..152274f67 100644 --- a/lightningd/pay.h +++ b/lightningd/pay.h @@ -7,6 +7,7 @@ #include struct htlc_out; +struct json_result; struct lightningd; struct route_hop; struct sha256; @@ -86,4 +87,10 @@ void payment_failed(struct lightningd *ld, const struct htlc_out *hout, /* Inform payment system to save the payment. */ void payment_store(struct lightningd *ld, const struct sha256 *payment_hash); +/* Output the fields of a payment. Caller should have put the + * response within a JSON object and is responsible for + * closing the object. */ +void json_add_payment_fields(struct json_result *response, + const struct wallet_payment *t); + #endif /* LIGHTNING_LIGHTNINGD_PAY_H */