commit_tx: update HTLC-tx fees to match latest BOLT.

As per lightning-rfc BOLT #3 ec99f893f320e8c88f564c1c8566f3454f0f1f5f:
"fixed htlc weight calculation"

Reported-by: Fabrice Drouin <fabrice.drouin@acinq.fr>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-02-21 15:15:28 +10:30
parent 35909ba94a
commit 726e7226c4
2 changed files with 14 additions and 21 deletions

View File

@@ -55,10 +55,10 @@ u64 htlc_timeout_fee(u64 feerate_per_kw)
*
* The fee for an HTLC-timeout transaction MUST BE calculated to match:
*
* 1. Multiply `feerate-per-kw` by 634 and divide by 1000 (rounding
* 1. Multiply `feerate-per-kw` by 635 and divide by 1000 (rounding
* down).
*/
return feerate_per_kw * 634 / 1000;
return feerate_per_kw * 635 / 1000;
}
u64 htlc_success_fee(u64 feerate_per_kw)
@@ -67,10 +67,10 @@ u64 htlc_success_fee(u64 feerate_per_kw)
*
* The fee for an HTLC-success transaction MUST BE calculated to match:
*
* 1. Multiply `feerate-per-kw` by 671 and divide by 1000 (rounding
* 1. Multiply `feerate-per-kw` by 673 and divide by 1000 (rounding
* down).
*/
return feerate_per_kw * 671 / 1000;
return feerate_per_kw * 673 / 1000;
}
static const struct htlc **untrimmed(const tal_t *ctx,