Browse Source

tx: expose elements 'is fee' calculation

we'll use it when figuring out what outputs to account for during
a withdrawal.
nifty/pset-pre
lisa neigut 5 years ago
committed by Rusty Russell
parent
commit
3d241bc261
  1. 2
      bitcoin/tx.c
  2. 5
      bitcoin/tx.h

2
bitcoin/tx.c

@ -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 &&

5
bitcoin/tx.h

@ -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…
Cancel
Save