plugin: Add connect and disconnect notifications

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-12-13 13:58:40 +01:00
parent 5813567856
commit 26f17e87a3
6 changed files with 47 additions and 0 deletions

View File

@@ -38,6 +38,7 @@
#include <lightningd/jsonrpc.h>
#include <lightningd/log.h>
#include <lightningd/memdump.h>
#include <lightningd/notification.h>
#include <lightningd/onchain_control.h>
#include <lightningd/opening_control.h>
#include <lightningd/options.h>
@@ -381,6 +382,7 @@ void channel_errmsg(struct channel *channel,
/* Make sure channel_fail_permanent doesn't tell connectd we died! */
channel->connected = false;
notify_disconnect(channel->peer->ld, &channel->peer->id);
/* BOLT #1:
*
@@ -504,6 +506,8 @@ void peer_connected(struct lightningd *ld, const u8 *msg,
abort();
}
notify_connect(ld, &id, &addr);
/* No err, all good. */
error = NULL;