Browse Source

channel: Passing gossipd client fd to channeld

ppa-0.6.1
Christian Decker 8 years ago
parent
commit
34c96399b0
  1. 7
      lightningd/channel/channel.c
  2. 3
      lightningd/channel/channel_wire.csv
  3. 1
      lightningd/peer_control.c

7
lightningd/channel/channel.c

@ -51,6 +51,8 @@ struct peer {
u8 *req_in;
const u8 **peer_out;
int gossip_client_fd;
};
static void msg_enqueue(const u8 ***q, const u8 *add)
@ -199,6 +201,11 @@ int main(int argc, char *argv[])
status_failed(WIRE_CHANNEL_BAD_COMMAND, "%s",
tal_hex(msg, msg));
tal_free(msg);
peer->gossip_client_fd = fdpass_recv(REQ_FD);
if (peer->gossip_client_fd == -1)
status_failed(
WIRE_CHANNEL_BAD_COMMAND,
"Did not receive a valid client socket to gossipd");
/* We derive everything from the one secret seed. */
derive_basepoints(&seed, &funding_pubkey[LOCAL], &points[LOCAL],

3
lightningd/channel/channel_wire.csv

@ -16,7 +16,8 @@ channel_normal_operation,1001
#include <lightningd/cryptomsg.h>
#include <lightningd/channel_config.h>
# Begin! You're still waiting for the tx to be buried though.
# Begin! You're still waiting for the tx to be buried though (passes
# gossipd-client fd)
channel_init,1
channel_init,0,funding_txid,32,struct sha256_double
channel_init,32,funding_txout,2

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

1
lightningd/peer_control.c

@ -669,6 +669,7 @@ static void peer_start_channeld(struct peer *peer, bool am_funder,
/* We don't expect a response: we are triggered by funding_depth_cb. */
subd_send_msg(peer->owner, take(msg));
subd_send_fd(peer->owner, peer->gossip_client_fd);
}
static bool opening_release_tx(struct subd *opening, const u8 *resp,

Loading…
Cancel
Save