diff --git a/bitcoin/tx.c b/bitcoin/tx.c index 6be607b74d18..f6fb836de084 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -443,14 +443,19 @@ u8 *linearize_wtx(const tal_t *ctx, const struct wally_tx *wtx) return arr; } -size_t bitcoin_tx_weight(const struct bitcoin_tx *tx) +size_t wally_tx_weight(const struct wally_tx *wtx) { size_t weight; - int ret = wally_tx_get_weight(tx->wtx, &weight); + int ret = wally_tx_get_weight(wtx, &weight); assert(ret == WALLY_OK); return weight; } +size_t bitcoin_tx_weight(const struct bitcoin_tx *tx) +{ + return wally_tx_weight(tx->wtx); +} + void wally_txid(const struct wally_tx *wtx, struct bitcoin_txid *txid) { u8 *arr; diff --git a/bitcoin/tx.h b/bitcoin/tx.h index 40d7f6969412..3ebac3f4ae17 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -59,6 +59,7 @@ u8 *linearize_wtx(const tal_t *ctx, const struct wally_tx *wtx); /* Get weight of tx in Sipa. */ size_t bitcoin_tx_weight(const struct bitcoin_tx *tx); +size_t wally_tx_weight(const struct wally_tx *wtx); /* Allocate a tx: you just need to fill in inputs and outputs (they're * zeroed with inputs' sequence_number set to FFFFFFFF) */