Skip to content

Commit dbc4c6c

Browse files
rpc: use the standart port derivation in connect command
Complete implementation of BOLT1 port derivation proposal lightning/bolts#968 Changelog-Added: rpc: use the standard port derivation in connect command when the port is not specified. Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 80db867 commit dbc4c6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightningd/connect_control.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "config.h"
2+
#include <bitcoin/chainparams.h>
23
#include <ccan/err/err.h>
34
#include <ccan/tal/str/str.h>
45
#include <common/configdir.h>
@@ -140,7 +141,7 @@ static struct command_result *json_connect(struct command *cmd,
140141
/* Is there a port? */
141142
if (!port) {
142143
port = tal(cmd, u32);
143-
*port = DEFAULT_PORT;
144+
*port = DEFAULT_PORT + chainparams->rpc_port - 8332;
144145
}
145146
addr = tal(cmd, struct wireaddr_internal);
146147
if (!parse_wireaddr_internal(name, addr, *port, false,

0 commit comments

Comments
 (0)