mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-25 00:34:19 +01:00
Fund all (#1249)
* Funding channel with "all" * Added test for fund all
This commit is contained in:
committed by
Christian Decker
parent
5737853123
commit
489d8d04a6
@@ -91,7 +91,7 @@ static void json_withdraw(struct command *cmd,
|
||||
u32 feerate_per_kw = get_feerate(cmd->ld->topology, FEERATE_NORMAL);
|
||||
u64 fee_estimate;
|
||||
struct bitcoin_tx *tx;
|
||||
bool withdraw_all = false;
|
||||
bool all_funds = false;
|
||||
enum address_parse_result addr_parse;
|
||||
|
||||
if (!json_get_params(cmd, buffer, params,
|
||||
@@ -105,7 +105,7 @@ static void json_withdraw(struct command *cmd,
|
||||
withdraw->cmd = cmd;
|
||||
|
||||
if (json_tok_streq(buffer, sattok, "all"))
|
||||
withdraw_all = true;
|
||||
all_funds = true;
|
||||
else if (!json_tok_u64(buffer, sattok, &withdraw->amount)) {
|
||||
command_fail(cmd, "Invalid satoshis");
|
||||
return;
|
||||
@@ -132,7 +132,7 @@ static void json_withdraw(struct command *cmd,
|
||||
}
|
||||
|
||||
/* Select the coins */
|
||||
if (withdraw_all) {
|
||||
if (all_funds) {
|
||||
withdraw->utxos = wallet_select_all(cmd, cmd->ld->wallet,
|
||||
feerate_per_kw,
|
||||
tal_len(withdraw->destination),
|
||||
|
||||
Reference in New Issue
Block a user