mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
channel: Passing gossipd client fd to channeld
This commit is contained in:
parent
3045e25624
commit
34c96399b0
@ -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],
|
||||
|
@ -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
|
||||
|
|
@ -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…
Reference in New Issue
Block a user