mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
wally: Migrate main daemon to use wally transactions
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
c39963b8b7
commit
d651ce6f3b
@@ -20,9 +20,10 @@
|
||||
static struct amount_sat calc_tx_fee(struct amount_sat sat_in,
|
||||
const struct bitcoin_tx *tx)
|
||||
{
|
||||
struct amount_sat fee = sat_in;
|
||||
for (size_t i = 0; i < tal_count(tx->output); i++) {
|
||||
if (!amount_sat_sub(&fee, fee, tx->output[i].amount))
|
||||
struct amount_sat amt, fee = sat_in;
|
||||
for (size_t i = 0; i < tx->wtx->num_outputs; i++) {
|
||||
amt = bitcoin_tx_output_get_amount(tx, i);
|
||||
if (!amount_sat_sub(&fee, fee, amt))
|
||||
fatal("Tx spends more than input %s? %s",
|
||||
type_to_string(tmpctx, struct amount_sat, &sat_in),
|
||||
type_to_string(tmpctx, struct bitcoin_tx, tx));
|
||||
|
||||
Reference in New Issue
Block a user