Skip to content

Commit

Permalink
Mark PackageSolvingData::HolderHTLCOutput weight unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
tankyleo committed Jan 7, 2025
1 parent 490bbdf commit 508d577
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lightning/src/chain/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,9 @@ impl PackageSolvingData {
PackageSolvingData::RevokedHTLCOutput(ref outp) => outp.weight as usize,
PackageSolvingData::CounterpartyOfferedHTLCOutput(ref outp) => outp.weight as usize,
PackageSolvingData::CounterpartyReceivedHTLCOutput(ref outp) => outp.weight as usize,
PackageSolvingData::HolderHTLCOutput(ref outp) => {
debug_assert!(outp.channel_type_features.supports_anchors_zero_fee_htlc_tx());
if outp.preimage.is_none() {
weight_offered_htlc(&outp.channel_type_features) as usize
} else {
weight_received_htlc(&outp.channel_type_features) as usize
}
},
// Since HolderHLTCOutput requires external funding, we never inquire the witness
// weight of the HTLC transaction here. See OnchainTxHandler::generate_claim.
PackageSolvingData::HolderHTLCOutput(ref _outp) => unreachable!(),
// Since HolderFundingOutput maps to an untractable package that is already signed, its
// weight can be determined from the transaction itself.
PackageSolvingData::HolderFundingOutput(..) => unreachable!(),
Expand Down

0 comments on commit 508d577

Please sign in to comment.