Browse Source

gossip: Added internal gossip message to add a local channel

Couldn't find a good place to put these messages, we probably want to
do the same capability based request routing that we did for the HSM,
but for now this just defines the message in the master messages file.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
2988e290cf
  1. 4
      gossipd/gossip.c
  2. 13
      gossipd/gossip_wire.csv
  3. 4
      lightningd/gossip_control.c

4
gossipd/gossip.c

@ -1539,6 +1539,7 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
case WIRE_GOSSIP_GETPEERS_REQUEST:
return get_peers(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:
case WIRE_GOSSIP_GETNODES_REPLY:
@ -1552,7 +1553,8 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
case WIRE_GOSSIP_GET_UPDATE:
case WIRE_GOSSIP_GET_UPDATE_REPLY:
case WIRE_GOSSIP_SEND_GOSSIP:
break;
case WIRE_GOSSIP_LOCAL_ADD_CHANNEL:
break;
}
/* Master shouldn't give bad requests. */

13
gossipd/gossip_wire.csv

@ -144,3 +144,16 @@ gossip_send_gossip,3016
gossip_send_gossip,,gossip_index,u64
gossip_send_gossip,,len,u16
gossip_send_gossip,,gossip,len*u8
# Both sides have seen the funding tx being locked, but we have not
# yet reached the announcement depth. So we add the channel locally so
# we can use it already.
gossip_local_add_channel,3017
gossip_local_add_channel,,short_channel_id,struct short_channel_id
gossip_local_add_channel,,chain_hash,struct sha256_double
gossip_local_add_channel,,remote_node_id,struct pubkey
gossip_local_add_channel,,flags,u16
gossip_local_add_channel,,cltv_expiry_delta,u16
gossip_local_add_channel,,htlc_minimum_msat,u64
gossip_local_add_channel,,fee_base_msat,u32
gossip_local_add_channel,,fee_proportional_millionths,u32
Can't render this file because it has a wrong number of fields in line 5.

4
lightningd/gossip_control.c

@ -83,6 +83,10 @@ static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLY:
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL:
break;
/* These are inter-daemon messages, not received by us */
case WIRE_GOSSIP_LOCAL_ADD_CHANNEL:
break;
case WIRE_GOSSIP_PEER_CONNECTED:
if (tal_count(fds) != 2)
return 2;

Loading…
Cancel
Save