gossip: Added message to notify gossipd of outpoint spends

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-03-26 20:10:03 +02:00
parent 1b604d5dd6
commit 5571f2143e
3 changed files with 14 additions and 0 deletions

View file

@ -1987,6 +1987,13 @@ handle_mark_channel_unroutable(struct io_conn *conn,
return daemon_conn_read_next(conn, &daemon->master);
}
static struct io_plan *handle_outpoint_spent(struct io_conn *conn,
struct daemon *daemon,
const u8 *msg)
{
return daemon_conn_read_next(conn, &daemon->master);
}
static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master)
{
struct daemon *daemon = container_of(master, struct daemon, master);
@ -2044,6 +2051,9 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
case WIRE_GOSSIPCTL_PEER_DISCONNECT:
return disconnect_peer(conn, daemon, master->msg_in);
case WIRE_GOSSIP_OUTPOINT_SPENT:
return handle_outpoint_spent(conn, daemon, master->msg_in);
/* We send these, we don't receive them */
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLY:
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL:

View file

@ -225,6 +225,9 @@ gossipctl_peer_disconnect_reply,3123
gossipctl_peer_disconnect_replyfail,3223
gossipctl_peer_disconnect_replyfail,,isconnected,bool
# master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel
gossip_outpoint_spent,3024
gossip_outpoint_spent,,short_channel_id,struct short_channel_id
# gossip_store messages: messages persisted in the gossip_store
gossip_store_channel_announcement,4096

1 #include <common/cryptomsg.h>
225
226
227
228
229
230
231
232
233

View file

@ -133,6 +133,7 @@ static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
case WIRE_GOSSIP_SEND_GOSSIP:
case WIRE_GOSSIP_GET_TXOUT_REPLY:
case WIRE_GOSSIP_DISABLE_CHANNEL:
case WIRE_GOSSIP_OUTPOINT_SPENT:
case WIRE_GOSSIP_ROUTING_FAILURE:
case WIRE_GOSSIP_MARK_CHANNEL_UNROUTABLE:
case WIRE_GOSSIPCTL_PEER_DISCONNECT: