core-lightning/lightningd/build_utxos.h
Christian Decker 7738bccf42 wallet: Move coin-selection primitives to wallet
We'll re-use them a few times so having them at a central location is
nice. We also fix a bug that was unreserving UTXO entries upon free,
instead of promoting them to being spent.
2017-06-23 16:02:20 +09:30

15 lines
532 B
C

#ifndef LIGHTNING_LIGHTNINGD_BUILD_UTXOS_H
#define LIGHTNING_LIGHTNINGD_BUILD_UTXOS_H
#include "config.h"
#include <lightningd/lightningd.h>
#include <lightningd/utxo.h>
/* Reserves UTXOs to build tx which pays this amount; returns NULL if
* impossible. *change_satoshis 0 if no change needed. */
const struct utxo **build_utxos(const tal_t *ctx,
struct lightningd *ld, u64 satoshi_out,
u32 feerate_per_kw, u64 dust_limit,
u64 *change_satoshis, u32 *change_keyindex);
#endif /* LIGHTNING_LIGHTNINGD_BUILD_UTXOS_H */