mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
also return preimage on listinvoices.
This commit is contained in:
@@ -61,6 +61,7 @@ static void json_add_invoice(struct json_stream *response,
|
|||||||
"msatoshi_received",
|
"msatoshi_received",
|
||||||
"amount_received_msat");
|
"amount_received_msat");
|
||||||
json_add_u64(response, "paid_at", inv->paid_timestamp);
|
json_add_u64(response, "paid_at", inv->paid_timestamp);
|
||||||
|
json_add_preimage(response, "payment_preimage", &inv->r);
|
||||||
}
|
}
|
||||||
if (inv->description)
|
if (inv->description)
|
||||||
json_add_string(response, "description", inv->description);
|
json_add_string(response, "description", inv->description);
|
||||||
@@ -572,7 +573,6 @@ static void gossipd_incoming_channels_reply(struct subd *gossipd,
|
|||||||
json_add_sha256(response, "payment_hash", &details->rhash);
|
json_add_sha256(response, "payment_hash", &details->rhash);
|
||||||
json_add_u64(response, "expires_at", details->expiry_time);
|
json_add_u64(response, "expires_at", details->expiry_time);
|
||||||
json_add_string(response, "bolt11", details->bolt11);
|
json_add_string(response, "bolt11", details->bolt11);
|
||||||
json_add_preimage(response, "preimage", &details->r);
|
|
||||||
|
|
||||||
/* Warn if there's not sufficient incoming capacity. */
|
/* Warn if there's not sufficient incoming capacity. */
|
||||||
if (tal_count(info->b11->routes) == 0) {
|
if (tal_count(info->b11->routes) == 0) {
|
||||||
|
|||||||
@@ -517,6 +517,7 @@ def test_sendpay(node_factory):
|
|||||||
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['status'] == 'paid'
|
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['status'] == 'paid'
|
||||||
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['pay_index'] == 1
|
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['pay_index'] == 1
|
||||||
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['msatoshi_received'] == rs['msatoshi']
|
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['msatoshi_received'] == rs['msatoshi']
|
||||||
|
assert only_one(l2.rpc.listinvoices('testpayment2')['invoices'])['payment_preimage'] == preimage
|
||||||
|
|
||||||
# Balances should reflect it.
|
# Balances should reflect it.
|
||||||
def check_balances():
|
def check_balances():
|
||||||
|
|||||||
Reference in New Issue
Block a user