Browse Source

wallet/walletrpc.c: fix uninitialized warning.

The withdraw_tx function shouldn't use it, but GCC is right it's uninitialized:

wallet/walletrpc.c: In function ‘json_prepare_tx’:
wallet/walletrpc.c:202:15: error: ‘changekey’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
1510ea5717
  1. 3
      wallet/walletrpc.c

3
wallet/walletrpc.c

@ -198,7 +198,8 @@ static struct command_result *json_prepare_tx(struct command *cmd,
if (!bip32_pubkey(cmd->ld->wallet->bip32_base, changekey,
(*utx)->wtx->change_key_index))
return command_fail(cmd, LIGHTNINGD, "Keys generation failure");
}
} else
changekey = NULL;
(*utx)->tx = withdraw_tx(*utx, get_chainparams(cmd->ld), (*utx)->wtx->utxos,
(*utx)->destination, (*utx)->wtx->amount,

Loading…
Cancel
Save