Skip to content

Commit 73b2223

Browse files
author
Antoine Riard
committed
-f Add debug_assert in untractable paths
1 parent 8dcdf1d commit 73b2223

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lightning/src/chain/onchain_utils.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ impl PackageSolvingData {
202202
let amt = match self {
203203
PackageSolvingData::RevokedOutput(ref outp) => { outp.amount },
204204
PackageSolvingData::CounterpartyHTLCOutput(ref outp) => { outp.htlc.amount_msat / 1000 },
205+
// Note: Currently, amounts of holder outputs spending witnesses aren't used
206+
// as we can't malleate spending package to increase their feerate. This
207+
// should change with the remaining anchor output patchset.
205208
PackageSolvingData::HolderHTLCOutput(..) => { 0 },
206209
PackageSolvingData::HolderFundingOutput(..) => { 0 },
207210
};
@@ -214,8 +217,8 @@ impl PackageSolvingData {
214217
// Note: Currently, weights of holder outputs spending witnesses aren't used
215218
// as we can't malleate spending package to increase their feerate. This
216219
// should change with the remaining anchor output patchset.
217-
PackageSolvingData::HolderHTLCOutput(..) => { 0 },
218-
PackageSolvingData::HolderFundingOutput(..) => { 0 },
220+
PackageSolvingData::HolderHTLCOutput(..) => { debug_assert!(false); 0 },
221+
PackageSolvingData::HolderFundingOutput(..) => { debug_assert!(false); 0 },
219222
};
220223
weight
221224
}

lightning/src/chain/onchaintx.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ impl<ChannelSigner: Sign> OnchainTxHandler<ChannelSigner> {
346346
return Some((new_timer, new_feerate, transaction))
347347
}
348348
} else {
349+
// Note: Currently, amounts of holder outputs spending witnesses aren't used
350+
// as we can't malleate spending package to increase their feerate. This
351+
// should change with the remaining anchor output patchset.
352+
debug_assert!(amt == 0);
349353
if let Some(transaction) = cached_request.finalize_package(self, amt, self.destination_script.clone(), logger) {
350354
return Some((None, 0, transaction));
351355
}

0 commit comments

Comments
 (0)