Skip to content

Commit 9aff815

Browse files
committed
bitcoin: method for finding weight of 'wally_tx'
1 parent 4057308 commit 9aff815

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

bitcoin/tx.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,19 @@ u8 *linearize_wtx(const tal_t *ctx, const struct wally_tx *wtx)
443443
return arr;
444444
}
445445

446-
size_t bitcoin_tx_weight(const struct bitcoin_tx *tx)
446+
size_t wally_tx_weight(const struct wally_tx *wtx)
447447
{
448448
size_t weight;
449-
int ret = wally_tx_get_weight(tx->wtx, &weight);
449+
int ret = wally_tx_get_weight(wtx, &weight);
450450
assert(ret == WALLY_OK);
451451
return weight;
452452
}
453453

454+
size_t bitcoin_tx_weight(const struct bitcoin_tx *tx)
455+
{
456+
return wally_tx_weight(tx->wtx);
457+
}
458+
454459
void wally_txid(const struct wally_tx *wtx, struct bitcoin_txid *txid)
455460
{
456461
u8 *arr;

bitcoin/tx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ u8 *linearize_wtx(const tal_t *ctx, const struct wally_tx *wtx);
5959

6060
/* Get weight of tx in Sipa. */
6161
size_t bitcoin_tx_weight(const struct bitcoin_tx *tx);
62+
size_t wally_tx_weight(const struct wally_tx *wtx);
6263

6364
/* Allocate a tx: you just need to fill in inputs and outputs (they're
6465
* zeroed with inputs' sequence_number set to FFFFFFFF) */

0 commit comments

Comments
 (0)