mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
273029f244
This sets the nLockTime to the tip (and accordingly each input's nSequence to 0xfffffffe) for withdrawal transactions. Even if the anti fee-sniping argument might not be valid until some time yet, this makes our regular wallet transactions far less distinguishable from bitcoind's ones since it now defaults to using native Segwit transactions (like us). Moreover other wallets are likely to implement this (if they haven't already). Changelog-Added: wallet: withdrawal transactions now sets nlocktime to the current tip.
40 lines
1.4 KiB
C
40 lines
1.4 KiB
C
#ifndef LIGHTNING_COMMON_WITHDRAW_TX_H
|
|
#define LIGHTNING_COMMON_WITHDRAW_TX_H
|
|
#include "config.h"
|
|
#include <bitcoin/chainparams.h>
|
|
#include <bitcoin/tx.h>
|
|
#include <ccan/short_types/short_types.h>
|
|
#include <ccan/tal/tal.h>
|
|
#include <common/amount.h>
|
|
|
|
struct bitcoin_tx;
|
|
struct ext_key;
|
|
struct privkey;
|
|
struct pubkey;
|
|
struct bitcoin_address;
|
|
struct utxo;
|
|
|
|
/**
|
|
* withdraw_tx - Create a p2pkh withdrawal transaction
|
|
*
|
|
* @ctx: context to tal from.
|
|
* @chainparams: (in) the params for the created transaction.
|
|
* @utxos: (in/out) tal_arr of UTXO pointers to spend (permuted to match)
|
|
* @outputs: (in) tal_arr of bitcoin_tx_output, scriptPubKeys with amount to send to.
|
|
* @changekey: (in) key to send change to (only used if change_satoshis != 0).
|
|
* @change: (in) amount to send as change.
|
|
* @bip32_base: (in) bip32 base for key derivation, or NULL.
|
|
* @change_outnum: (out) set to output index of change output or -1 if none, unless NULL.
|
|
* @nlocktime: (in) the value to set as the transaction's nLockTime.
|
|
*/
|
|
struct bitcoin_tx *withdraw_tx(const tal_t *ctx,
|
|
const struct chainparams *chainparams,
|
|
const struct utxo **utxos,
|
|
struct bitcoin_tx_output **outputs,
|
|
const struct pubkey *changekey,
|
|
struct amount_sat change,
|
|
const struct ext_key *bip32_base,
|
|
int *change_outnum, u32 nlocktime);
|
|
|
|
#endif /* LIGHTNING_COMMON_WITHDRAW_TX_H */
|