Skip to content

Commit dc5693e

Browse files
committed
Account for fuzz HTLC signature weight
When secp256k1_fuzz is active, dummy ECDSA signatures may serialize one byte larger per signature. Add two WU to the HTLC-resolution witness estimates so debug weight assertions use the fuzz signer bound.
1 parent 7e1454c commit dc5693e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • lightning/src/events/bump_transaction

lightning/src/events/bump_transaction/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ impl<B: BroadcasterInterface, C: CoinSelectionSource, SP: SignerProvider, L: Log
547547
} else {
548548
panic!("channel type should be either zero-fee HTLCs, or zero-fee commitments");
549549
};
550+
// The secp256k1 fuzz signer emits dummy signatures without low-S normalization, so
551+
// DER+sighash can be one byte larger for each of the two HTLC signatures.
552+
#[cfg(secp256k1_fuzz)]
553+
let (htlc_success_witness_weight, htlc_timeout_witness_weight) =
554+
(htlc_success_witness_weight + 2, htlc_timeout_witness_weight + 2);
550555

551556
let max_tx_weight = if channel_type.supports_anchor_zero_fee_commitments() {
552557
// Cap the size of transactions claiming `HolderHTLCOutput` in 0FC channels.

0 commit comments

Comments
 (0)