]> git.bitcoin.ninja Git - rust-lightning/commitdiff
[tests] Correct witness len calc in StaticOutputCounterpartyPayment
authorMatt Corallo <git@bluematt.me>
Wed, 3 Feb 2021 03:45:53 +0000 (22:45 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 16 Feb 2021 17:40:06 +0000 (12:40 -0500)
We previously counted 35 bytes for a length + public key, but in
reality they are never larger than 34 bytes - 33 for the key and 1
for the push length.

lightning/src/ln/functional_tests.rs

index 53e7649d19b693effba8790f66da986eb482a35e..11a202d5471c992bbe33457c502d510c5e95e5d0 100644 (file)
@@ -4744,7 +4744,7 @@ macro_rules! check_spendable_outputs {
                                                                                input: vec![input],
                                                                                output: vec![outp.clone()],
                                                                        };
-                                                                       spend_tx.output[0].value -= (spend_tx.get_weight() + 2 + 1 + 73 + 35 + 3) as u64 / 4; // (Max weight + 3 (to round up)) / 4
+                                                                       spend_tx.output[0].value -= (spend_tx.get_weight() + 2 + 1 + 73 + 34 + 3) as u64 / 4; // (Max weight + 3 (to round up)) / 4
                                                                        let secret = {
                                                                                match ExtendedPrivKey::new_master(Network::Testnet, &$node.node_seed) {
                                                                                        Ok(master_key) => {