mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 23:54:22 +01:00
bitcoin: method for finding weight of 'wally_tx'
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) */
|
||||
|
||||
Reference in New Issue
Block a user