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>
This commit is contained in:
Rusty Russell 2019-08-01 11:04:05 +09:30 committed by Christian Decker
parent 296cfe8d1b
commit 1510ea5717

View file

@ -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,