Remove code fragments with no effect
[rust-lightning] / src / ln / channelmanager.rs
index dc7ac2a816106a1bd2919cc8587615d6237c7245..b1d81695b40d8d2cf13dcb39a037f44783a2c7a9 100644 (file)
@@ -478,7 +478,6 @@ impl ChannelManager {
        fn construct_onion_keys_callback<T: secp256k1::Signing, FType: FnMut(SharedSecret, [u8; 32], PublicKey, &RouteHop)> (secp_ctx: &Secp256k1<T>, route: &Route, session_priv: &SecretKey, mut callback: FType) -> Result<(), HandleError> {
                let mut blinded_priv = session_priv.clone();
                let mut blinded_pub = PublicKey::from_secret_key(secp_ctx, &blinded_priv);
-               let mut first_iteration = true;
 
                for hop in route.hops.iter() {
                        let shared_secret = SharedSecret::new(secp_ctx, &hop.pubkey, &blinded_priv);
@@ -489,10 +488,6 @@ impl ChannelManager {
                        let mut blinding_factor = [0u8; 32];
                        sha.result(&mut blinding_factor);
 
-                       if first_iteration {
-                               blinded_pub = PublicKey::from_secret_key(secp_ctx, &blinded_priv);
-                               first_iteration = false;
-                       }
                        let ephemeral_pubkey = blinded_pub;
 
                        secp_call!(blinded_priv.mul_assign(secp_ctx, &secp_call!(SecretKey::from_slice(secp_ctx, &blinding_factor))));
@@ -2274,7 +2269,6 @@ mod tests {
        }
 
        struct Node {
-               feeest: Arc<test_utils::TestFeeEstimator>,
                chain_monitor: Arc<chaininterface::ChainWatchInterfaceUtil>,
                tx_broadcaster: Arc<test_utils::TestBroadcaster>,
                chan_monitor: Arc<test_utils::TestChannelMonitor>,
@@ -2827,7 +2821,7 @@ mod tests {
                        };
                        let node = ChannelManager::new(node_id.clone(), 0, true, Network::Testnet, feeest.clone(), chan_monitor.clone(), chain_monitor.clone(), tx_broadcaster.clone(), Arc::clone(&logger)).unwrap();
                        let router = Router::new(PublicKey::from_secret_key(&secp_ctx, &node_id), Arc::clone(&logger));
-                       nodes.push(Node { feeest, chain_monitor, tx_broadcaster, chan_monitor, node, router });
+                       nodes.push(Node { chain_monitor, tx_broadcaster, chan_monitor, node, router });
                }
 
                nodes