From 3d241bc26166133ef95a05a79f4a0e5f8deb1e75 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Wed, 1 Apr 2020 20:34:00 -0500 Subject: [PATCH] tx: expose elements 'is fee' calculation we'll use it when figuring out what outputs to account for during a withdrawal. --- bitcoin/tx.c | 2 +- bitcoin/tx.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index c01b41a4f..0aa6d1d90 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -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 && diff --git a/bitcoin/tx.h b/bitcoin/tx.h index 64470eb9d..59e2395ab 100644 --- a/bitcoin/tx.h +++ b/bitcoin/tx.h @@ -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 */