mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
2632cc3f34
Using param_tok is generally deprecated, as it doesn't give any sanity checking for the JSON 'check' command. So make param_wtx usable directly, and also make it have a struct amount_sat. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
34 lines
935 B
C
34 lines
935 B
C
#ifndef LIGHTNING_COMMON_WALLET_TX_H
|
|
#define LIGHTNING_COMMON_WALLET_TX_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
#include <common/amount.h>
|
|
#include <lightningd/json.h>
|
|
#include <lightningd/jsonrpc.h>
|
|
#include <lightningd/lightningd.h>
|
|
|
|
/* A specification of funds in the wallet used for funding channels and
|
|
* withdrawal.
|
|
*/
|
|
struct wallet_tx {
|
|
struct command *cmd;
|
|
struct amount_sat amount, change;
|
|
u32 change_key_index;
|
|
const struct utxo **utxos;
|
|
|
|
bool all_funds; /* In this case, amount is a maximum. */
|
|
};
|
|
|
|
void wtx_init(struct command *cmd, struct wallet_tx *wtx, struct amount_sat max);
|
|
|
|
struct command_result *param_wtx(struct command *cmd,
|
|
const char *name,
|
|
const char *buffer,
|
|
const jsmntok_t *tok,
|
|
struct wallet_tx *wtx);
|
|
|
|
struct command_result *wtx_select_utxos(struct wallet_tx *tx,
|
|
u32 fee_rate_per_kw,
|
|
size_t out_len);
|
|
#endif /* LIGHTNING_COMMON_WALLET_TX_H */
|