Skip to content

Commit 508d577

Browse files
committed
Mark PackageSolvingData::HolderHTLCOutput weight unreachable
1 parent 490bbdf commit 508d577

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lightning/src/chain/package.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,9 @@ impl PackageSolvingData {
540540
PackageSolvingData::RevokedHTLCOutput(ref outp) => outp.weight as usize,
541541
PackageSolvingData::CounterpartyOfferedHTLCOutput(ref outp) => outp.weight as usize,
542542
PackageSolvingData::CounterpartyReceivedHTLCOutput(ref outp) => outp.weight as usize,
543-
PackageSolvingData::HolderHTLCOutput(ref outp) => {
544-
debug_assert!(outp.channel_type_features.supports_anchors_zero_fee_htlc_tx());
545-
if outp.preimage.is_none() {
546-
weight_offered_htlc(&outp.channel_type_features) as usize
547-
} else {
548-
weight_received_htlc(&outp.channel_type_features) as usize
549-
}
550-
},
543+
// Since HolderHLTCOutput requires external funding, we never inquire the witness
544+
// weight of the HTLC transaction here. See OnchainTxHandler::generate_claim.
545+
PackageSolvingData::HolderHTLCOutput(ref _outp) => unreachable!(),
551546
// Since HolderFundingOutput maps to an untractable package that is already signed, its
552547
// weight can be determined from the transaction itself.
553548
PackageSolvingData::HolderFundingOutput(..) => unreachable!(),

0 commit comments

Comments
 (0)