Browse Source

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

ppa-0.6.1
Igor Cota 7 years ago
committed by Christian Decker
parent
commit
8c00e4f98d
  1. 5
      lightningd/bitcoind.c
  2. 2
      lightningd/bitcoind.h
  3. 3
      lightningd/options.c

5
lightningd/bitcoind.c

@ -48,6 +48,10 @@ static const char **gather_args(const struct bitcoind *bitcoind,
add_arg(&args, add_arg(&args,
tal_fmt(args, "-rpcconnect=%s", bitcoind->rpcconnect)); tal_fmt(args, "-rpcconnect=%s", bitcoind->rpcconnect));
if (bitcoind->rpcport)
add_arg(&args,
tal_fmt(args, "-rpcport=%s", bitcoind->rpcport));
if (bitcoind->rpcuser) if (bitcoind->rpcuser)
add_arg(&args, tal_fmt(args, "-rpcuser=%s", 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->rpcuser = NULL;
bitcoind->rpcpass = NULL; bitcoind->rpcpass = NULL;
bitcoind->rpcconnect = NULL; bitcoind->rpcconnect = NULL;
bitcoind->rpcport = NULL;
list_head_init(&bitcoind->pending); list_head_init(&bitcoind->pending);
tal_add_destructor(bitcoind, destroy_bitcoind); tal_add_destructor(bitcoind, destroy_bitcoind);

2
lightningd/bitcoind.h

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

3
lightningd/options.c

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

Loading…
Cancel
Save