mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-02 18:35:00 +01:00
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:
parent
9c4c0f10fb
commit
3d241bc261
2 changed files with 6 additions and 1 deletions
|
@ -63,7 +63,7 @@ int bitcoin_tx_add_multi_outputs(struct bitcoin_tx *tx,
|
||||||
return tx->wtx->num_outputs;
|
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);
|
assert(outnum < tx->wtx->num_outputs);
|
||||||
return chainparams->is_elements &&
|
return chainparams->is_elements &&
|
||||||
|
|
|
@ -172,4 +172,9 @@ bool bitcoin_tx_check(const struct bitcoin_tx *tx);
|
||||||
*/
|
*/
|
||||||
void bitcoin_tx_finalize(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 */
|
#endif /* LIGHTNING_BITCOIN_TX_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue