mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
bitcoin: Make chainparams const
`cli` and `cli_args` were not `const` before since they are added to a non-`const` array. Using `cast_const` we can keep them `const` without unsafe cast. Reported-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
5fdb8a58aa
commit
2c0b52fb77
@ -11,8 +11,8 @@ struct chainparams {
|
||||
const char *network_name;
|
||||
const struct sha256_double genesis_blockhash;
|
||||
const int rpc_port;
|
||||
char *cli;
|
||||
char *cli_args;
|
||||
const char *cli;
|
||||
const char *cli_args;
|
||||
const u64 dust_limit;
|
||||
|
||||
/* Whether this is a test network or not */
|
||||
|
@ -30,8 +30,8 @@ static char **gather_args(struct bitcoind *bitcoind,
|
||||
size_t n = 0;
|
||||
char **args = tal_arr(ctx, char *, 3);
|
||||
|
||||
args[n++] = bitcoind->chainparams->cli;
|
||||
args[n++] = bitcoind->chainparams->cli_args;
|
||||
args[n++] = cast_const(char *, bitcoind->chainparams->cli);
|
||||
args[n++] = cast_const(char *, bitcoind->chainparams->cli_args);
|
||||
|
||||
if (bitcoind->datadir) {
|
||||
args[n++] = tal_fmt(args, "-datadir=%s", bitcoind->datadir);
|
||||
|
Loading…
Reference in New Issue
Block a user