mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-08 07:34:20 +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:
committed by
Christian Decker
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user