lightningdevkit/rust-lightning

`HTLC_{SUCCESS,TIMEOUT}_INPUT_ANCHOR_WITNESS_WEIGHT` are probably too high

TheBlueMatt opened this issue · 0 comments

ANCHOR_INPUT_WITNESS_WEIGHT was too high by 2 (causing us to overpay fees by two weight units), and it was fixed in #3285 because a test required it. The HTLC constants are probably also wrong, but it shouldn't cause anything other than overpaying by two weight units per input, which isn't a huge deal. We should fix them, though, plus add a comment explaining how all three constants are calculated (the ANCHOR_INPUT_WITNESS_WEIGHT is 40 byte redeemscript, plus 71/72 bytes for a signature and 2 length bytes and a witness element count).