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:
Christian Decker
2019-07-30 16:14:43 +02:00
committed by Rusty Russell
parent 2537bd5afa
commit 9288a7906b
32 changed files with 244 additions and 138 deletions

View File

@@ -1,6 +1,7 @@
#ifndef LIGHTNING_CHANNELD_COMMIT_TX_H
#define LIGHTNING_CHANNELD_COMMIT_TX_H
#include "config.h"
#include <bitcoin/chainparams.h>
#include <bitcoin/pubkey.h>
#include <channeld/channeld_htlc.h>
#include <common/htlc.h>
@@ -43,6 +44,7 @@ size_t commit_tx_num_untrimmed(const struct htlc **htlcs,
* transaction, so we carefully use the terms "self" and "other" here.
*/
struct bitcoin_tx *commit_tx(const tal_t *ctx,
const struct chainparams *chainparams,
const struct bitcoin_txid *funding_txid,
unsigned int funding_txout,
struct amount_sat funding,