core-lightning/lightningd/build_utxos.h
Rusty Russell ccff3ac437 lightningd/funding_tx: fill in scriptsigs for p2sh UTXOs.
This is a bit tricky: for our signing code, we don't want scriptsigs,
but to calculate the txid, we need them.  For most transactions in lightning,
they're pure segwit so it doesn't matter, but funding transactions can
have P2SH-wrapped P2WPKH inputs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-07 11:31:55 +10:30

17 lines
652 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);
/* Once we've spent them, mark them confirmed. */
void confirm_utxos(struct lightningd *ld, const struct utxo **utxos);
#endif /* LIGHTNING_LIGHTNINGD_BUILD_UTXOS_H */