Browse Source

gossip: Added message to notify gossipd of outpoint spends

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
5571f2143e
  1. 10
      gossipd/gossip.c
  2. 3
      gossipd/gossip_wire.csv
  3. 1
      lightningd/gossip_control.c

10
gossipd/gossip.c

@ -1987,6 +1987,13 @@ handle_mark_channel_unroutable(struct io_conn *conn,
return daemon_conn_read_next(conn, &daemon->master); 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) static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master)
{ {
struct daemon *daemon = container_of(master, struct daemon, 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: case WIRE_GOSSIPCTL_PEER_DISCONNECT:
return disconnect_peer(conn, daemon, master->msg_in); 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 */ /* We send these, we don't receive them */
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLY: case WIRE_GOSSIPCTL_RELEASE_PEER_REPLY:
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL: case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL:

3
gossipd/gossip_wire.csv

@ -225,6 +225,9 @@ gossipctl_peer_disconnect_reply,3123
gossipctl_peer_disconnect_replyfail,3223 gossipctl_peer_disconnect_replyfail,3223
gossipctl_peer_disconnect_replyfail,,isconnected,bool 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 messages: messages persisted in the gossip_store
gossip_store_channel_announcement,4096 gossip_store_channel_announcement,4096

Can't render this file because it has a wrong number of fields in line 6.

1
lightningd/gossip_control.c

@ -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_SEND_GOSSIP:
case WIRE_GOSSIP_GET_TXOUT_REPLY: case WIRE_GOSSIP_GET_TXOUT_REPLY:
case WIRE_GOSSIP_DISABLE_CHANNEL: case WIRE_GOSSIP_DISABLE_CHANNEL:
case WIRE_GOSSIP_OUTPOINT_SPENT:
case WIRE_GOSSIP_ROUTING_FAILURE: case WIRE_GOSSIP_ROUTING_FAILURE:
case WIRE_GOSSIP_MARK_CHANNEL_UNROUTABLE: case WIRE_GOSSIP_MARK_CHANNEL_UNROUTABLE:
case WIRE_GOSSIPCTL_PEER_DISCONNECT: case WIRE_GOSSIPCTL_PEER_DISCONNECT:

Loading…
Cancel
Save