tx: expose elements 'is fee' calculation

we'll use it when figuring out what outputs to account for during
a withdrawal.
This commit is contained in:
lisa neigut 2020-04-01 20:34:00 -05:00 committed by Rusty Russell
parent 9c4c0f10fb
commit 3d241bc261
2 changed files with 6 additions and 1 deletions

View file

@ -63,7 +63,7 @@ int bitcoin_tx_add_multi_outputs(struct bitcoin_tx *tx,
return tx->wtx->num_outputs;
}
static bool elements_tx_output_is_fee(const struct bitcoin_tx *tx, int outnum)
bool elements_tx_output_is_fee(const struct bitcoin_tx *tx, int outnum)
{
assert(outnum < tx->wtx->num_outputs);
return chainparams->is_elements &&

View file

@ -172,4 +172,9 @@ 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_tx_output_is_fee(const struct bitcoin_tx *tx, int outnum);
#endif /* LIGHTNING_BITCOIN_TX_H */