mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-22 23:34:21 +01:00
tx: Add chainparams to struct bitcoin_tx as context
The way we build transactions, serialize them, and compute fees depends on the chain we are working on, so let's add some context to the transactions. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
2537bd5afa
commit
9288a7906b
@@ -60,6 +60,7 @@ u8 *to_self_wscript(const tal_t *ctx,
|
||||
}
|
||||
|
||||
struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
|
||||
const struct chainparams *chainparams,
|
||||
const struct bitcoin_txid *funding_txid,
|
||||
unsigned int funding_txout,
|
||||
struct amount_sat funding,
|
||||
@@ -146,7 +147,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
|
||||
|
||||
|
||||
/* Worst-case sizing: both to-local and to-remote outputs. */
|
||||
tx = bitcoin_tx(ctx, 1, untrimmed + 2);
|
||||
tx = bitcoin_tx(ctx, chainparams, 1, untrimmed + 2);
|
||||
|
||||
/* This could be done in a single loop, but we follow the BOLT
|
||||
* literally to make comments in test vectors clearer. */
|
||||
|
||||
Reference in New Issue
Block a user