]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Remove trivial assertions in LocalCommitmentTransaction fns 2020-04-559-cleanups
authorMatt Corallo <git@bluematt.me>
Fri, 24 Apr 2020 19:31:33 +0000 (15:31 -0400)
committerMatt Corallo <git@bluematt.me>
Sat, 25 Apr 2020 01:23:51 +0000 (21:23 -0400)
We don't need to assert that transaction structure is what we
expect when the transaction is created by a function twenty lines
up in the same file.

lightning/src/ln/chan_utils.rs

index d576fd338cf692271ceb5ff85ffc6c31fd1b2ce0..62d3103337d828943cba7e59adbd3b78f9f67ba9 100644 (file)
@@ -614,8 +614,6 @@ impl LocalCommitmentTransaction {
                for this_htlc in self.per_htlc.iter() {
                        if this_htlc.0.transaction_output_index.is_some() {
                                let htlc_tx = build_htlc_transaction(&txid, self.feerate_per_kw, local_csv, &this_htlc.0, &self.local_keys.a_delayed_payment_key, &self.local_keys.revocation_key);
-                               assert_eq!(htlc_tx.input.len(), 1);
-                               assert_eq!(htlc_tx.input[0].witness.len(), 0);
 
                                let htlc_redeemscript = get_htlc_redeemscript_with_explicit_keys(&this_htlc.0, &self.local_keys.a_htlc_key, &self.local_keys.b_htlc_key, &self.local_keys.revocation_key);
 
@@ -642,8 +640,6 @@ impl LocalCommitmentTransaction {
                // Channel should have checked that we have a remote signature for this HTLC at
                // creation, and we should have a sensible htlc transaction:
                assert!(this_htlc.1.is_some());
-               assert_eq!(htlc_tx.input.len(), 1);
-               assert_eq!(htlc_tx.input[0].witness.len(), 0);
 
                let htlc_redeemscript = get_htlc_redeemscript_with_explicit_keys(&this_htlc.0, &self.local_keys.a_htlc_key, &self.local_keys.b_htlc_key, &self.local_keys.revocation_key);