Skip to content

Commit 3963a92

Browse files
committed
gossipd: don't need hsm fd any more.
gossipd no longer makes gossip messages, and hasn't since v24.02, so it doesn't actually need to talk to the hsm daemon. Also, various comments were out of date, so fix those too. Signed-off-by: Rusty Russell <[email protected]>
1 parent ed43977 commit 3963a92

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

gossipd/gossipd.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*~ Welcome to the gossip daemon: keeper of maps!
22
*
3-
* This is the last "global" daemon; it has three purposes.
3+
* This is the last "global" daemon; it has one main purpose: to
4+
* maintain the append-only gossip_store file for other daemons and
5+
* plugins to read the global network map.
46
*
5-
* 1. To determine routes for payments when lightningd asks.
6-
* 2. The second purpose is to receive gossip from peers (via their
7-
* per-peer daemons) and send it out to them.
8-
* 3. Talk to `connectd` to to answer address queries for nodes.
7+
* To do this, it gets gossip messages forwarded from connectd, makes
8+
* gossip queries to peers, and can ask connect out to random peers to
9+
* get more gossip.
910
*
1011
* The gossip protocol itself is fairly simple, but has some twists which
1112
* add complexity to this daemon.
@@ -14,7 +15,6 @@
1415
#include <ccan/tal/str/str.h>
1516
#include <common/clock_time.h>
1617
#include <common/daemon_conn.h>
17-
#include <common/ecdh_hsmd.h>
1818
#include <common/memleak.h>
1919
#include <common/status.h>
2020
#include <common/subdaemon.h>
@@ -591,9 +591,6 @@ int main(int argc, char *argv[])
591591
daemon->deferred_txouts = tal_arr(daemon, struct short_channel_id, 0);
592592
daemon->current_blockheight = 0; /* i.e. unknown */
593593

594-
/* Tell the ecdh() function how to talk to hsmd */
595-
ecdh_hsmd_setup(HSM_FD, status_failed);
596-
597594
/* Note the use of time_mono() here. That's a monotonic clock, which
598595
* is really useful: it can only be used to measure relative events
599596
* (there's no correspondence to time-since-Ken-grew-a-beard or
@@ -620,8 +617,9 @@ int main(int argc, char *argv[])
620617
}
621618
}
622619

623-
/*~ Note that the actual routing stuff is in routing.c; you might want to
624-
* check that out later.
620+
/*~ Note that the production of the gossip_store file is in gossmap_manage.c
621+
* and gossip_store.c, and the (highly optimized!) read side is in
622+
* common/gossmap.c; you might want to check those out later.
625623
*
626624
* But that's the last of the global daemons. We now move on to the first of
627625
* the per-peer daemons: openingd/openingd.c.

gossipd/gossipd.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
#include <lightningd/options.h>
99
#include <wire/peer_wire.h>
1010

11-
/* We talk to `hsmd` to sign our gossip messages with the node key */
12-
#define HSM_FD 3
13-
/* connectd asks us for help finding nodes, and gossip fds for new peers */
14-
#define CONNECTD_FD 4
15-
#define CONNECTD2_FD 5
11+
/* connectd forwards gossip messages to us. */
12+
#define CONNECTD_FD 3
1613

1714
struct chan;
1815
struct peer;

lightningd/gossip_control.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,11 @@ static void gossipd_init_done(struct subd *gossipd,
302302
void gossip_init(struct lightningd *ld, int connectd_fd)
303303
{
304304
u8 *msg;
305-
int hsmfd;
306305
void *ret;
307306

308-
hsmfd = hsm_get_global_fd(ld, HSM_PERM_ECDH|HSM_PERM_SIGN_GOSSIP);
309-
310307
ld->gossip = new_global_subd(ld, "lightning_gossipd",
311308
gossipd_wire_name, gossip_msg,
312-
take(&hsmfd), take(&connectd_fd), NULL);
309+
take(&connectd_fd), NULL);
313310
if (!ld->gossip)
314311
err(1, "Could not subdaemon gossip");
315312

0 commit comments

Comments
 (0)