From: Matt Corallo Date: Wed, 3 Feb 2021 03:45:53 +0000 (-0500) Subject: [tests] Correct witness len calc in StaticOutputCounterpartyPayment X-Git-Tag: v0.0.13~28^2~10 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=311555a191a9fcca304044fb59c6061e6992ef68;p=rust-lightning [tests] Correct witness len calc in StaticOutputCounterpartyPayment 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. --- diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index 53e7649d1..11a202d54 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -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) => {