core-lightning/common/wallet_tx.h
Mark Beckwith 7767b68ee9 Removed redundancies in withdraw and fundchannel.
No new functionality, just a continuation of my work toward completing #665.

I removed the common members of `struct withdrawal` and `struct fund_channel`
and placed them in a new `struct wallet_tx`.  Then it was fairly straightforward
to reimplement the existing code in terms of `wallet_tx`.

Since I made some structural changes I wanted to get this approved before I
go any farther.

Added 'all' to fundchannel help message.
2018-05-03 18:20:20 +02:00

26 lines
656 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 <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;
u64 amount;
u64 change;
u32 change_key_index;
const struct utxo **utxos;
bool all_funds;
};
void wtx_init(struct command *cmd, struct wallet_tx *wtx);
bool wtx_select_utxos(struct wallet_tx * tx, u32 fee_rate_per_kw,
size_t out_len);
#endif /* LIGHTNING_COMMON_WALLET_TX_H */