X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=9a586254beaad85cce559fa898846db5135b2ffe;hp=e22186ec2d8aae254b6f869fece0ab4ffa0548b6;hb=HEAD;hpb=8b6434e946cc559a4c87349fecb97609c913682d diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index e22186ec..9a586254 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -961,6 +961,8 @@ impl Channel { } else { (value_to_self_msat / 1000, value_to_remote_msat / 1000 - total_fee as i64 - ANCHOR_VALUE_SATOSHIS as i64) }; + debug_assert!(value_to_self >= 0); + debug_assert!(value_to_remote >= 0); let value_to_a = if local { value_to_self } else { value_to_remote }; let value_to_b = if local { value_to_remote } else { value_to_self }; @@ -998,6 +1000,7 @@ impl Channel { }, None)); } + transaction_utils::sort_outputs(&mut txouts, |a, b| { if let &Some(ref a_htlc) = a { if let &Some(ref b_htlc) = b { @@ -4443,8 +4446,6 @@ mod tests { #[test] fn outbound_commitment_test() { - return; // Disabled as we don't have test vectors for the currently-partially-implemented option_anchor_outputs - // Test vectors from BOLT 3 Appendix C: let feeest = TestFeeEstimator{fee_est: 15000}; let logger : Arc = Arc::new(test_utils::TestLogger::new());