mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
fix: Only add cli_args if we have some defined
This was causing calls to `bitcoin-cli` to fail on mainnet since it was interpreting the empty string as the RPC method to call.
This commit is contained in:
parent
f802e98e73
commit
f085a474b2
@ -13,7 +13,7 @@ const struct chainparams networks[] = {
|
||||
0x0a, 0x8c, 0xe2, 0x6f}}},
|
||||
.rpc_port = 8332,
|
||||
.cli = "bitcoin-cli",
|
||||
.cli_args = "",
|
||||
.cli_args = NULL,
|
||||
.dust_limit = 546,
|
||||
.testnet = false},
|
||||
{.index = 1,
|
||||
|
@ -28,10 +28,13 @@ static char **gather_args(struct bitcoind *bitcoind,
|
||||
const tal_t *ctx, const char *cmd, va_list ap)
|
||||
{
|
||||
size_t n = 0;
|
||||
char **args = tal_arr(ctx, char *, 3);
|
||||
char **args = tal_arr(ctx, char *, 2);
|
||||
|
||||
args[n++] = cast_const(char *, bitcoind->chainparams->cli);
|
||||
args[n++] = cast_const(char *, bitcoind->chainparams->cli_args);
|
||||
if (bitcoind->chainparams->cli_args) {
|
||||
args[n++] = cast_const(char *, bitcoind->chainparams->cli_args);
|
||||
tal_resize(&args, n + 1);
|
||||
}
|
||||
|
||||
if (bitcoind->datadir) {
|
||||
args[n++] = tal_fmt(args, "-datadir=%s", bitcoind->datadir);
|
||||
|
Loading…
Reference in New Issue
Block a user