Skip to content

Commit 2ca697a

Browse files
committed
Fix some newly-introduced unused-$THING warnings
1 parent cd8f1de commit 2ca697a

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

src/ln/functional_test_utils.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use util::logger::Logger;
1515
use util::config::UserConfig;
1616

1717
use bitcoin::util::hash::BitcoinHash;
18-
use bitcoin::blockdata::block::{BlockHeader, Block};
18+
use bitcoin::blockdata::block::BlockHeader;
1919
use bitcoin::blockdata::transaction::{Transaction, TxOut};
2020
use bitcoin::network::constants::Network;
2121

@@ -56,20 +56,6 @@ pub fn connect_blocks(chain: &chaininterface::ChainWatchInterfaceUtil, depth: u3
5656
header.bitcoin_hash()
5757
}
5858

59-
pub fn disconnect_blocks(chain: &chaininterface::ChainWatchInterfaceUtil, depth: u32, height: u32, parent: bool, prev_blockhash: Sha256d) {
60-
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 };
61-
let mut blocks = Vec::new();
62-
for _ in 0..depth {
63-
blocks.push(Block { header, txdata: Vec::new() });
64-
header = BlockHeader { version: 0x20000000, prev_blockhash: header.bitcoin_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
65-
}
66-
let mut height = height;
67-
for block in blocks.pop() {
68-
chain.block_disconnected(&block.header, height);
69-
height -= 1;
70-
}
71-
}
72-
7359
pub struct Node {
7460
pub chain_monitor: Arc<chaininterface::ChainWatchInterfaceUtil>,
7561
pub tx_broadcaster: Arc<test_utils::TestBroadcaster>,

src/ln/functional_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,8 +5664,8 @@ fn do_test_sweep_outbound_htlc_failure_update(revoked: bool, local: bool) {
56645664

56655665
let bs_dust_limit = nodes[1].node.channel_state.lock().unwrap().by_id.get(&chan.2).unwrap().our_dust_limit_satoshis;
56665666

5667-
let (payment_preimage_1, dust_hash) = route_payment(&nodes[0], &[&nodes[1]], bs_dust_limit*1000);
5668-
let (payment_preimage_2, non_dust_hash) = route_payment(&nodes[0], &[&nodes[1]], 1000000);
5667+
let (_payment_preimage_1, dust_hash) = route_payment(&nodes[0], &[&nodes[1]], bs_dust_limit*1000);
5668+
let (_payment_preimage_2, non_dust_hash) = route_payment(&nodes[0], &[&nodes[1]], 1000000);
56695669

56705670
let as_commitment_tx = nodes[0].node.channel_state.lock().unwrap().by_id.get(&chan.2).unwrap().last_local_commitment_txn.clone();
56715671
let bs_commitment_tx = nodes[1].node.channel_state.lock().unwrap().by_id.get(&chan.2).unwrap().last_local_commitment_txn.clone();

src/ln/msgs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl LocalFeatures {
9494
pub(crate) fn supports_upfront_shutdown_script(&self) -> bool {
9595
self.flags.len() > 0 && (self.flags[0] & (3 << 4)) != 0
9696
}
97+
#[cfg(test)]
9798
pub(crate) fn unset_upfront_shutdown_script(&mut self) {
9899
self.flags[0] ^= 1 << 4;
99100
}

0 commit comments

Comments
 (0)