Fix weight calc that ignored the witness flag and dummy bytes
authorMatt Corallo <git@bluematt.me>
Sun, 14 Apr 2019 20:14:04 +0000 (16:14 -0400)
committerMatt Corallo <git@bluematt.me>
Sun, 14 Apr 2019 20:14:04 +0000 (16:14 -0400)
src/ln/channelmonitor.rs

index 1888117e849585fb20e7cf307b51171de0a3e246..0bc03ae6d0d008ae307052a3a84d261c71e5928d 100644 (file)
@@ -487,7 +487,7 @@ impl ChannelMonitor {
        }
 
        fn get_witnesses_weight(inputs: &Vec<InputDescriptors>) -> u64 {
-               let mut tx_weight = 0;
+               let mut tx_weight = 2;
                for inp in inputs {
                        // We use expected weight (and not actual) as signatures and time lock delays may vary
                        tx_weight +=  match inp {