]> git.bitcoin.ninja Git - rust-lightning/commit
Correct `ANCHOR_INPUT_WITNESS_WEIGHT` constant 2024-08-tx-too-small
authorMatt Corallo <git@bluematt.me>
Tue, 3 Sep 2024 15:09:32 +0000 (15:09 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 Sep 2024 15:09:32 +0000 (15:09 +0000)
commit5f5c275ea3b7b2ed28c5853c8dafa3e2a2f73003
treeb0da2b1848716c245fbd1c5b13a45bb78e3ab417
parent5a2372ce8e185fbaa662f98cc67da96c2dc922df
Correct `ANCHOR_INPUT_WITNESS_WEIGHT` constant

`ANCHOR_INPUT_WITNESS_WEIGHT` is too high by two weight units,
likely it was calculated to include the SegWit marker bytes, but
it is used to describe an `Input::satisfaction_weight`, which does
not expect the marker bytes.

This corrects that oversight, reducing the constant by two and
adding the marker bytes back in our own internal weight
calculations. It also fixes a second issue where the constant was
too low by one when `grind_signatures` is not set, as that may
result in a signature being one byte longer than we expect.
lightning/src/events/bump_transaction.rs
lightning/src/ln/chan_utils.rs