Fix some newly-introduced unused-$THING warnings
authorMatt Corallo <git@bluematt.me>
Mon, 22 Jul 2019 21:46:17 +0000 (17:46 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 23 Jul 2019 19:52:20 +0000 (15:52 -0400)
src/ln/functional_test_utils.rs
src/ln/functional_tests.rs
src/ln/msgs.rs

index 777ec829287a48b56a18266094a736f1a7729c31..e1be9cc173fdc59f54ba5b61b30469bd8e2a9623 100644 (file)
@@ -15,7 +15,7 @@ use util::logger::Logger;
 use util::config::UserConfig;
 
 use bitcoin::util::hash::BitcoinHash;
-use bitcoin::blockdata::block::{BlockHeader, Block};
+use bitcoin::blockdata::block::BlockHeader;
 use bitcoin::blockdata::transaction::{Transaction, TxOut};
 use bitcoin::network::constants::Network;
 
@@ -56,20 +56,6 @@ pub fn connect_blocks(chain: &chaininterface::ChainWatchInterfaceUtil, depth: u3
        header.bitcoin_hash()
 }
 
-pub fn disconnect_blocks(chain: &chaininterface::ChainWatchInterfaceUtil, depth: u32, height: u32, parent: bool, prev_blockhash: Sha256d) {
-       let mut header = BlockHeader { version: 0x2000000, prev_blockhash: if parent { prev_blockhash } else { Default::default() }, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
-       let mut blocks = Vec::new();
-       for _ in 0..depth {
-               blocks.push(Block { header, txdata: Vec::new() });
-               header = BlockHeader { version: 0x20000000, prev_blockhash: header.bitcoin_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
-       }
-       let mut height = height;
-       for block in blocks.pop() {
-               chain.block_disconnected(&block.header, height);
-               height -= 1;
-       }
-}
-
 pub struct Node {
        pub chain_monitor: Arc<chaininterface::ChainWatchInterfaceUtil>,
        pub tx_broadcaster: Arc<test_utils::TestBroadcaster>,
index 4c6cde82c4b7df1e1389f3f160aec0868afd274a..918ba3ca9352e908cfc9af9d73d1453b01a3a2c4 100644 (file)
@@ -5664,8 +5664,8 @@ fn do_test_sweep_outbound_htlc_failure_update(revoked: bool, local: bool) {
 
        let bs_dust_limit = nodes[1].node.channel_state.lock().unwrap().by_id.get(&chan.2).unwrap().our_dust_limit_satoshis;
 
-       let (payment_preimage_1, dust_hash) = route_payment(&nodes[0], &[&nodes[1]], bs_dust_limit*1000);
-       let (payment_preimage_2, non_dust_hash) = route_payment(&nodes[0], &[&nodes[1]], 1000000);
+       let (_payment_preimage_1, dust_hash) = route_payment(&nodes[0], &[&nodes[1]], bs_dust_limit*1000);
+       let (_payment_preimage_2, non_dust_hash) = route_payment(&nodes[0], &[&nodes[1]], 1000000);
 
        let as_commitment_tx = nodes[0].node.channel_state.lock().unwrap().by_id.get(&chan.2).unwrap().last_local_commitment_txn.clone();
        let bs_commitment_tx = nodes[1].node.channel_state.lock().unwrap().by_id.get(&chan.2).unwrap().last_local_commitment_txn.clone();
index 6c910865388d965e69f7c92ba6f91d10d5e9d04a..12bed996878dff27145e33654f92391975604a20 100644 (file)
@@ -94,6 +94,7 @@ impl LocalFeatures {
        pub(crate) fn supports_upfront_shutdown_script(&self) -> bool {
                self.flags.len() > 0 && (self.flags[0] & (3 << 4)) != 0
        }
+       #[cfg(test)]
        pub(crate) fn unset_upfront_shutdown_script(&mut self) {
                self.flags[0] ^= 1 << 4;
        }