Skip to content

Commit ee08dd3

Browse files
committed
connectd: recover the chainparams
We are going to signal the genesis block hash in the init message.
1 parent b9a03a0 commit ee08dd3

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

connectd/connect_wire.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <lightningd/gossip_msg.h>
55

66
msgtype,connectctl_init,2000
7+
msgdata,connectctl_init,chainparams,chainparams,
78
msgdata,connectctl_init,id,node_id,
89
msgdata,connectctl_init,num_wireaddrs,u16,
910
msgdata,connectctl_init,wireaddrs,wireaddr_internal,num_wireaddrs

connectd/connectd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ struct daemon {
151151

152152
/* Allow to define the default behavior of tot services calls*/
153153
bool use_v3_autotor;
154+
155+
/* What network are we running on ? */
156+
const struct chainparams *chainparams;
154157
};
155158

156159
/* Peers we're trying to reach: we iterate through addrs until we succeed
@@ -1145,6 +1148,7 @@ static struct io_plan *connect_init(struct io_conn *conn,
11451148
/* Fields which require allocation are allocated off daemon */
11461149
if (!fromwire_connectctl_init(
11471150
daemon, msg,
1151+
&daemon->chainparams,
11481152
&daemon->id,
11491153
&proposed_wireaddr,
11501154
&proposed_listen_announce,

0 commit comments

Comments
 (0)