Skip to content

Commit c7934b0

Browse files
committed
fix all clippy::redundant_field_names warnings
1 parent 8566486 commit c7934b0

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

lightning/src/chain/channelmonitor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
981981

982982
counterparty_tx_cache,
983983
funding_redeemscript,
984-
channel_value_satoshis: channel_value_satoshis,
984+
channel_value_satoshis,
985985
their_cur_revocation_points: None,
986986

987987
on_holder_tx_csv,
@@ -1129,7 +1129,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
11291129
delayed_payment_key: commitment_tx.keys.broadcaster_delayed_payment_key,
11301130
per_commitment_point: commitment_tx.keys.per_commitment_point,
11311131
feerate_per_kw: commitment_tx.feerate_per_kw,
1132-
htlc_outputs: htlc_outputs,
1132+
htlc_outputs,
11331133
};
11341134
self.onchain_tx_handler.provide_latest_holder_tx(commitment_tx);
11351135
self.current_holder_commitment_number = 0xffff_ffff_ffff - ((((sequence & 0xffffff) << 3*8) | (locktime as u64 & 0xffffff)) ^ self.commitment_transaction_number_obscure_factor);

lightning/src/ln/channel.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,14 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
487487
let feerate = fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::Normal);
488488

489489
Ok(Channel {
490-
user_id: user_id,
490+
user_id,
491491
config: config.channel_options.clone(),
492492

493493
channel_id: keys_provider.get_secure_random_bytes(),
494494
channel_state: ChannelState::OurInitSent as u32,
495495
channel_outbound: true,
496496
secp_ctx: Secp256k1::new(),
497-
channel_value_satoshis: channel_value_satoshis,
497+
channel_value_satoshis,
498498

499499
latest_monitor_update_id: 0,
500500

@@ -715,7 +715,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
715715
} else { None };
716716

717717
let chan = Channel {
718-
user_id: user_id,
718+
user_id,
719719
config: local_config,
720720

721721
channel_id: msg.temporary_channel_id,
@@ -766,7 +766,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
766766
feerate_per_kw: msg.feerate_per_kw,
767767
channel_value_satoshis: msg.funding_satoshis,
768768
counterparty_dust_limit_satoshis: msg.dust_limit_satoshis,
769-
holder_dust_limit_satoshis: holder_dust_limit_satoshis,
769+
holder_dust_limit_satoshis,
770770
counterparty_max_htlc_value_in_flight_msat: cmp::min(msg.max_htlc_value_in_flight_msat, msg.funding_satoshis * 1000),
771771
counterparty_selected_channel_reserve_satoshis: msg.channel_reserve_satoshis,
772772
counterparty_htlc_minimum_msat: msg.htlc_minimum_msat,
@@ -1579,7 +1579,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
15791579

15801580
Ok((msgs::FundingSigned {
15811581
channel_id: self.channel_id,
1582-
signature: signature
1582+
signature
15831583
}, channel_monitor))
15841584
}
15851585

@@ -2135,8 +2135,8 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
21352135

21362136
Ok((msgs::RevokeAndACK {
21372137
channel_id: self.channel_id,
2138-
per_commitment_secret: per_commitment_secret,
2139-
next_per_commitment_point: next_per_commitment_point,
2138+
per_commitment_secret,
2139+
next_per_commitment_point,
21402140
}, commitment_signed, closing_signed, monitor_update))
21412141
}
21422142

@@ -2240,7 +2240,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
22402240
update_fulfill_htlcs,
22412241
update_fail_htlcs,
22422242
update_fail_malformed_htlcs: Vec::new(),
2243-
update_fee: update_fee,
2243+
update_fee,
22442244
commitment_signed,
22452245
}, monitor_update)), htlcs_to_fail))
22462246
} else {
@@ -2497,7 +2497,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
24972497

24982498
Some(msgs::UpdateFee {
24992499
channel_id: self.channel_id,
2500-
feerate_per_kw: feerate_per_kw,
2500+
feerate_per_kw,
25012501
})
25022502
}
25032503

@@ -2623,7 +2623,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
26232623
let next_per_commitment_point = self.holder_keys.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx);
26242624
Some(msgs::FundingLocked {
26252625
channel_id: self.channel_id(),
2626-
next_per_commitment_point: next_per_commitment_point,
2626+
next_per_commitment_point,
26272627
})
26282628
} else { None };
26292629

@@ -2798,7 +2798,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
27982798
let next_per_commitment_point = self.holder_keys.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx);
27992799
return Ok((Some(msgs::FundingLocked {
28002800
channel_id: self.channel_id(),
2801-
next_per_commitment_point: next_per_commitment_point,
2801+
next_per_commitment_point,
28022802
}), None, None, None, RAACommitmentOrder::CommitmentFirst, shutdown_msg));
28032803
}
28042804

@@ -2828,7 +2828,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
28282828
let next_per_commitment_point = self.holder_keys.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx);
28292829
Some(msgs::FundingLocked {
28302830
channel_id: self.channel_id(),
2831-
next_per_commitment_point: next_per_commitment_point,
2831+
next_per_commitment_point,
28322832
})
28332833
} else { None };
28342834

@@ -3443,7 +3443,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
34433443
let next_per_commitment_point = self.holder_keys.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx);
34443444
return Ok((Some(msgs::FundingLocked {
34453445
channel_id: self.channel_id,
3446-
next_per_commitment_point: next_per_commitment_point,
3446+
next_per_commitment_point,
34473447
}), timed_out_htlcs));
34483448
} else {
34493449
self.monitor_pending_funding_locked = true;
@@ -3492,7 +3492,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
34923492
let keys = self.holder_keys.pubkeys();
34933493

34943494
msgs::OpenChannel {
3495-
chain_hash: chain_hash,
3495+
chain_hash,
34963496
temporary_channel_id: self.channel_id,
34973497
funding_satoshis: self.channel_value_satoshis,
34983498
push_msat: self.channel_value_satoshis * 1000 - self.value_to_self_msat,
@@ -3597,7 +3597,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
35973597
temporary_channel_id,
35983598
funding_txid: funding_txo.txid,
35993599
funding_output_index: funding_txo.index,
3600-
signature: signature
3600+
signature
36013601
})
36023602
}
36033603

@@ -3624,7 +3624,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
36243624

36253625
let msg = msgs::UnsignedChannelAnnouncement {
36263626
features: ChannelFeatures::known(),
3627-
chain_hash: chain_hash,
3627+
chain_hash,
36283628
short_channel_id: self.get_short_channel_id().unwrap(),
36293629
node_id_1: if were_node_one { node_id } else { self.get_counterparty_node_id() },
36303630
node_id_2: if were_node_one { self.get_counterparty_node_id() } else { node_id },

lightning/src/ln/channelmanager.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
11261126
PendingHTLCStatus::Forward(PendingHTLCInfo {
11271127
routing: PendingHTLCRouting::Forward {
11281128
onion_packet: outgoing_packet,
1129-
short_channel_id: short_channel_id,
1129+
short_channel_id,
11301130
},
11311131
payment_hash: msg.payment_hash.clone(),
11321132
incoming_shared_secret: shared_secret,
@@ -1221,7 +1221,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
12211221

12221222
let unsigned = msgs::UnsignedChannelUpdate {
12231223
chain_hash: self.genesis_hash,
1224-
short_channel_id: short_channel_id,
1224+
short_channel_id,
12251225
timestamp: chan.get_update_time_counter(),
12261226
flags: (!were_node_one) as u8 | ((!chan.is_live() as u8) << 1),
12271227
cltv_expiry_delta: CLTV_EXPIRY_DELTA,
@@ -1447,7 +1447,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
14471447
let mut channel_state = self.channel_state.lock().unwrap();
14481448
channel_state.pending_msg_events.push(events::MessageSendEvent::SendFundingCreated {
14491449
node_id: chan.get_counterparty_node_id(),
1450-
msg: msg,
1450+
msg,
14511451
});
14521452
match channel_state.by_id.entry(chan.channel_id()) {
14531453
hash_map::Entry::Occupied(_) => {
@@ -1745,14 +1745,14 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
17451745
}
17461746
} else if total_value == data.total_msat {
17471747
new_events.push(events::Event::PaymentReceived {
1748-
payment_hash: payment_hash,
1748+
payment_hash,
17491749
payment_secret: Some(data.payment_secret),
17501750
amt: total_value,
17511751
});
17521752
}
17531753
} else {
17541754
new_events.push(events::Event::PaymentReceived {
1755-
payment_hash: payment_hash,
1755+
payment_hash,
17561756
payment_secret: None,
17571757
amt: amt_to_forward,
17581758
});
@@ -2304,7 +2304,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
23042304
pending_events.push(events::Event::FundingGenerationReady {
23052305
temporary_channel_id: msg.temporary_channel_id,
23062306
channel_value_satoshis: value,
2307-
output_script: output_script,
2307+
output_script,
23082308
user_channel_id: user_id,
23092309
});
23102310
Ok(())
@@ -2384,7 +2384,7 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
23842384
};
23852385
let mut pending_events = self.pending_events.lock().unwrap();
23862386
pending_events.push(events::Event::FundingBroadcastSafe {
2387-
funding_txo: funding_txo,
2387+
funding_txo,
23882388
user_channel_id: user_id,
23892389
});
23902390
Ok(())

lightning/src/ln/onion_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ pub(super) fn build_failure_packet(shared_secret: &[u8], failure_type: u16, fail
306306
};
307307
let mut packet = msgs::DecodedOnionErrorPacket {
308308
hmac: [0; 32],
309-
failuremsg: failuremsg,
310-
pad: pad,
309+
failuremsg,
310+
pad,
311311
};
312312

313313
let mut hmac = HmacEngine::<Sha256>::new(&um);

lightning/src/ln/peer_channel_encryptor.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ impl PeerChannelEncryptor {
9595

9696
PeerChannelEncryptor {
9797
their_node_id: Some(their_node_id),
98-
secp_ctx: secp_ctx,
98+
secp_ctx,
9999
noise_state: NoiseState::InProgress {
100100
state: NoiseStep::PreActOne,
101101
directional_state: DirectionalNoiseState::Outbound {
102102
ie: ephemeral_key,
103103
},
104104
bidirectional_state: BidirectionalNoiseState {
105-
h: h,
105+
h,
106106
ck: NOISE_CK,
107107
},
108108
}
@@ -120,7 +120,7 @@ impl PeerChannelEncryptor {
120120

121121
PeerChannelEncryptor {
122122
their_node_id: None,
123-
secp_ctx: secp_ctx,
123+
secp_ctx,
124124
noise_state: NoiseState::InProgress {
125125
state: NoiseStep::PreActOne,
126126
directional_state: DirectionalNoiseState::Inbound {
@@ -129,7 +129,7 @@ impl PeerChannelEncryptor {
129129
temp_k2: None,
130130
},
131131
bidirectional_state: BidirectionalNoiseState {
132-
h: h,
132+
h,
133133
ck: NOISE_CK,
134134
},
135135
}
@@ -321,10 +321,10 @@ impl PeerChannelEncryptor {
321321

322322
let (sk, rk) = final_hkdf;
323323
self.noise_state = NoiseState::Finished {
324-
sk: sk,
324+
sk,
325325
sn: 0,
326326
sck: ck.clone(),
327-
rk: rk,
327+
rk,
328328
rn: 0,
329329
rck: ck,
330330
};
@@ -374,10 +374,10 @@ impl PeerChannelEncryptor {
374374

375375
let (rk, sk) = final_hkdf;
376376
self.noise_state = NoiseState::Finished {
377-
sk: sk,
377+
sk,
378378
sn: 0,
379379
sck: ck.clone(),
380-
rk: rk,
380+
rk,
381381
rn: 0,
382382
rck: ck,
383383
};

lightning/src/ln/peer_handler.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref> PeerManager<D
323323
pending_outbound_buffer_first_msg_offset: 0,
324324
awaiting_write_event: false,
325325

326-
pending_read_buffer: pending_read_buffer,
326+
pending_read_buffer,
327327
pending_read_buffer_pos: 0,
328328
pending_read_is_header: false,
329329

@@ -360,7 +360,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref> PeerManager<D
360360
pending_outbound_buffer_first_msg_offset: 0,
361361
awaiting_write_event: false,
362362

363-
pending_read_buffer: pending_read_buffer,
363+
pending_read_buffer,
364364
pending_read_buffer_pos: 0,
365365
pending_read_is_header: false,
366366

lightning/src/util/chacha20poly1305rfc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ mod real_chachapoly {
5151
ChaCha20Poly1305RFC::pad_mac_16(&mut mac, aad.len());
5252

5353
ChaCha20Poly1305RFC {
54-
cipher: cipher,
55-
mac: mac,
54+
cipher,
55+
mac,
5656
finished: false,
5757
data_len: 0,
5858
aad_len: aad.len() as u64,

0 commit comments

Comments
 (0)