mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-11 09:04:21 +01:00
bitcoin: pull up elements_fee calc to allow wtx passed in
We're moving away from bitcoin_tx, slowly
This commit is contained in:
11
bitcoin/tx.c
11
bitcoin/tx.c
@@ -98,11 +98,16 @@ int bitcoin_tx_add_multi_outputs(struct bitcoin_tx *tx,
|
||||
return tx->wtx->num_outputs;
|
||||
}
|
||||
|
||||
bool elements_wtx_output_is_fee(const struct wally_tx *tx, int outnum)
|
||||
{
|
||||
assert(outnum < tx->num_outputs);
|
||||
return chainparams->is_elements &&
|
||||
tx->outputs[outnum].script_len == 0;
|
||||
}
|
||||
|
||||
bool elements_tx_output_is_fee(const struct bitcoin_tx *tx, int outnum)
|
||||
{
|
||||
assert(outnum < tx->wtx->num_outputs);
|
||||
return chainparams->is_elements &&
|
||||
tx->wtx->outputs[outnum].script_len == 0;
|
||||
return elements_wtx_output_is_fee(tx->wtx, outnum);
|
||||
}
|
||||
|
||||
struct amount_sat bitcoin_tx_compute_fee_w_inputs(const struct bitcoin_tx *tx,
|
||||
|
||||
@@ -210,6 +210,11 @@ bool bitcoin_tx_check(const struct bitcoin_tx *tx);
|
||||
*/
|
||||
void bitcoin_tx_finalize(struct bitcoin_tx *tx);
|
||||
|
||||
/**
|
||||
* Returns true if the given outnum is a fee output
|
||||
*/
|
||||
bool elements_wtx_output_is_fee(const struct wally_tx *tx, int outnum);
|
||||
|
||||
/**
|
||||
* Returns true if the given outnum is a fee output
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user