Add --bitcoin-rpcport option to pass to bitcoin-rpc

This commit is contained in:
Igor Cota 2018-03-25 13:57:52 +02:00 committed by Christian Decker
parent 0bf1b01425
commit 8c00e4f98d
3 changed files with 9 additions and 1 deletions

View File

@ -48,6 +48,10 @@ static const char **gather_args(const struct bitcoind *bitcoind,
add_arg(&args,
tal_fmt(args, "-rpcconnect=%s", bitcoind->rpcconnect));
if (bitcoind->rpcport)
add_arg(&args,
tal_fmt(args, "-rpcport=%s", bitcoind->rpcport));
if (bitcoind->rpcuser)
add_arg(&args, tal_fmt(args, "-rpcuser=%s", bitcoind->rpcuser));
@ -804,6 +808,7 @@ struct bitcoind *new_bitcoind(const tal_t *ctx,
bitcoind->rpcuser = NULL;
bitcoind->rpcpass = NULL;
bitcoind->rpcconnect = NULL;
bitcoind->rpcport = NULL;
list_head_init(&bitcoind->pending);
tal_add_destructor(bitcoind, destroy_bitcoind);

View File

@ -54,7 +54,7 @@ struct bitcoind {
bool shutdown;
/* Passthrough parameters for bitcoin-cli */
char *rpcuser, *rpcpass, *rpcconnect;
char *rpcuser, *rpcpass, *rpcconnect, *rpcport;
};
struct bitcoind *new_bitcoind(const tal_t *ctx,

View File

@ -648,6 +648,9 @@ void register_opts(struct lightningd *ld)
opt_register_arg("--bitcoin-rpcconnect", opt_set_talstr, NULL,
&ld->topology->bitcoind->rpcconnect,
"bitcoind RPC host to connect to");
opt_register_arg("--bitcoin-rpcport", opt_set_talstr, NULL,
&ld->topology->bitcoind->rpcport,
"bitcoind RPC port");
opt_register_arg("--pid-file=<file>", opt_set_talstr, opt_show_charp,
&ld->pidfile,
"Specify pid file");