mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
tx: fix case where input amounts are less than total outputs
when attempting to calculate the fees for a tx where we don't own all of the outputs, we can overshoot the feerate
This commit is contained in:
parent
9830c94778
commit
ee549a2af9
@ -121,7 +121,9 @@ struct amount_sat bitcoin_tx_compute_fee_w_inputs(const struct bitcoin_tx *tx,
|
||||
|
||||
ok = amount_sat_sub(&input_val, input_val,
|
||||
amount_asset_to_sat(&asset));
|
||||
assert(ok);
|
||||
if (!ok)
|
||||
return AMOUNT_SAT(0);
|
||||
|
||||
}
|
||||
return input_val;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user