mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 06:54:30 +01:00
Pay: Notify 'sendpay_success' and 'sendpay_failure' when sendpay succeeds and fails
This commit is contained in:
committed by
Rusty Russell
parent
82e8db4ba4
commit
086f096b86
@@ -12,6 +12,7 @@
|
||||
#include <lightningd/jsonrpc.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/notification.h>
|
||||
#include <lightningd/options.h>
|
||||
#include <lightningd/peer_control.h>
|
||||
#include <lightningd/peer_htlcs.h>
|
||||
@@ -113,6 +114,7 @@ static struct command_result *sendpay_success(struct command *cmd,
|
||||
|
||||
assert(payment->status == PAYMENT_COMPLETE);
|
||||
|
||||
notify_sendpay_success(cmd->ld, payment);
|
||||
response = json_stream_success(cmd);
|
||||
json_add_payment_fields(response, payment);
|
||||
return command_success(cmd, response);
|
||||
@@ -183,6 +185,13 @@ sendpay_fail(struct command *cmd,
|
||||
details);
|
||||
}
|
||||
|
||||
notify_sendpay_failure(cmd->ld,
|
||||
payment,
|
||||
pay_errcode,
|
||||
onionreply,
|
||||
fail,
|
||||
errmsg);
|
||||
|
||||
data = json_stream_fail(cmd, pay_errcode,
|
||||
errmsg);
|
||||
json_sendpay_fail_fields(data,
|
||||
|
||||
Reference in New Issue
Block a user