MCPcopy Create free account
hub / github.com/ElementsProject/lightning / change_fee

Function change_fee

bitcoin/tx.c:967–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

965}
966
967struct amount_sat change_fee(u32 feerate_perkw, size_t total_weight)
968{
969 struct amount_sat fee;
970
971 /* Must be able to pay for its own additional weight */
972 /* Rounding can cause off by one errors, so we do this */
973 if (!amount_sat_sub(&fee,
974 amount_tx_fee(feerate_perkw, change_weight() + total_weight),
975 amount_tx_fee(feerate_perkw, total_weight)))
976 abort();
977 return fee;
978}
979
980struct amount_sat change_amount(struct amount_sat excess, u32 feerate_perkw,
981 size_t total_weight)

Callers 2

change_amountFunction · 0.85
change_for_emergencyFunction · 0.85

Calls 4

change_weightFunction · 0.85
abortFunction · 0.85
amount_sat_subFunction · 0.50
amount_tx_feeFunction · 0.50

Tested by

no test coverage detected