Skip to content

Commit 0f2c4c0

Browse files
authored
Merge pull request #2374 from arik-so/2023-06-build-warning-fixes
Fix build warnings
2 parents d327c23 + 89aa7ac commit 0f2c4c0

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

lightning/src/chain/package.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl Readable for CounterpartyOfferedHTLCOutput {
247247
let mut counterparty_htlc_base_key = RequiredWrapper(None);
248248
let mut preimage = RequiredWrapper(None);
249249
let mut htlc = RequiredWrapper(None);
250-
let mut legacy_deserialization_prevention_marker: Option<()> = None;
250+
let mut _legacy_deserialization_prevention_marker: Option<()> = None;
251251
let mut channel_type_features = None;
252252

253253
read_tlv_fields!(reader, {
@@ -256,7 +256,7 @@ impl Readable for CounterpartyOfferedHTLCOutput {
256256
(4, counterparty_htlc_base_key, required),
257257
(6, preimage, required),
258258
(8, htlc, required),
259-
(10, legacy_deserialization_prevention_marker, option),
259+
(10, _legacy_deserialization_prevention_marker, option),
260260
(11, channel_type_features, option),
261261
});
262262

@@ -321,15 +321,15 @@ impl Readable for CounterpartyReceivedHTLCOutput {
321321
let mut counterparty_delayed_payment_base_key = RequiredWrapper(None);
322322
let mut counterparty_htlc_base_key = RequiredWrapper(None);
323323
let mut htlc = RequiredWrapper(None);
324-
let mut legacy_deserialization_prevention_marker: Option<()> = None;
324+
let mut _legacy_deserialization_prevention_marker: Option<()> = None;
325325
let mut channel_type_features = None;
326326

327327
read_tlv_fields!(reader, {
328328
(0, per_commitment_point, required),
329329
(2, counterparty_delayed_payment_base_key, required),
330330
(4, counterparty_htlc_base_key, required),
331331
(6, htlc, required),
332-
(8, legacy_deserialization_prevention_marker, option),
332+
(8, _legacy_deserialization_prevention_marker, option),
333333
(9, channel_type_features, option),
334334
});
335335

@@ -399,14 +399,14 @@ impl Readable for HolderHTLCOutput {
399399
let mut amount_msat = RequiredWrapper(None);
400400
let mut cltv_expiry = RequiredWrapper(None);
401401
let mut preimage = None;
402-
let mut legacy_deserialization_prevention_marker: Option<()> = None;
402+
let mut _legacy_deserialization_prevention_marker: Option<()> = None;
403403
let mut channel_type_features = None;
404404

405405
read_tlv_fields!(reader, {
406406
(0, amount_msat, required),
407407
(2, cltv_expiry, required),
408408
(4, preimage, option),
409-
(6, legacy_deserialization_prevention_marker, option),
409+
(6, _legacy_deserialization_prevention_marker, option),
410410
(7, channel_type_features, option),
411411
});
412412

@@ -460,14 +460,14 @@ impl Writeable for HolderFundingOutput {
460460
impl Readable for HolderFundingOutput {
461461
fn read<R: io::Read>(reader: &mut R) -> Result<Self, DecodeError> {
462462
let mut funding_redeemscript = RequiredWrapper(None);
463-
let mut legacy_deserialization_prevention_marker: Option<()> = None;
463+
let mut _legacy_deserialization_prevention_marker: Option<()> = None;
464464
let mut channel_type_features = None;
465465
let mut funding_amount = None;
466466

467467
read_tlv_fields!(reader, {
468468
(0, funding_redeemscript, required),
469469
(1, channel_type_features, option),
470-
(2, legacy_deserialization_prevention_marker, option),
470+
(2, _legacy_deserialization_prevention_marker, option),
471471
(3, funding_amount, option)
472472
});
473473

lightning/src/ln/chan_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ impl Readable for ChannelTransactionParameters {
938938
let mut is_outbound_from_holder = RequiredWrapper(None);
939939
let mut counterparty_parameters = None;
940940
let mut funding_outpoint = None;
941-
let mut legacy_deserialization_prevention_marker: Option<()> = None;
941+
let mut _legacy_deserialization_prevention_marker: Option<()> = None;
942942
let mut channel_type_features = None;
943943

944944
read_tlv_fields!(reader, {
@@ -947,7 +947,7 @@ impl Readable for ChannelTransactionParameters {
947947
(4, is_outbound_from_holder, required),
948948
(6, counterparty_parameters, option),
949949
(8, funding_outpoint, option),
950-
(10, legacy_deserialization_prevention_marker, option),
950+
(10, _legacy_deserialization_prevention_marker, option),
951951
(11, channel_type_features, option),
952952
});
953953

@@ -1363,7 +1363,7 @@ impl Readable for CommitmentTransaction {
13631363
let mut keys = RequiredWrapper(None);
13641364
let mut built = RequiredWrapper(None);
13651365
_init_tlv_field_var!(htlcs, vec_type);
1366-
let mut legacy_deserialization_prevention_marker: Option<()> = None;
1366+
let mut _legacy_deserialization_prevention_marker: Option<()> = None;
13671367
let mut channel_type_features = None;
13681368

13691369
read_tlv_fields!(reader, {
@@ -1374,7 +1374,7 @@ impl Readable for CommitmentTransaction {
13741374
(8, keys, required),
13751375
(10, built, required),
13761376
(12, htlcs, vec_type),
1377-
(14, legacy_deserialization_prevention_marker, option),
1377+
(14, _legacy_deserialization_prevention_marker, option),
13781378
(15, channel_type_features, option),
13791379
});
13801380

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7405,7 +7405,7 @@ mod tests {
74057405
}
74067406
}
74077407

7408-
#[cfg(not(feature = "grind_signatures"))]
7408+
#[cfg(all(feature = "_test_vectors", not(feature = "grind_signatures")))]
74097409
fn public_from_secret_hex(secp_ctx: &Secp256k1<bitcoin::secp256k1::All>, hex: &str) -> PublicKey {
74107410
PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&hex::decode(hex).unwrap()[..]).unwrap())
74117411
}

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl core::hash::Hash for HTLCSource {
317317
}
318318
}
319319
impl HTLCSource {
320-
#[cfg(not(feature = "grind_signatures"))]
320+
#[cfg(all(feature = "_test_vectors", not(feature = "grind_signatures")))]
321321
#[cfg(test)]
322322
pub fn dummy() -> Self {
323323
HTLCSource::OutboundRoute {

lightning/src/ln/reload_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ fn test_manager_serialize_deserialize_inconsistent_monitor() {
384384
fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) };
385385
persister = test_utils::TestPersister::new();
386386
let keys_manager = &chanmon_cfgs[0].keys_manager;
387-
new_chain_monitor = test_utils::TestChainMonitor::new(Some(nodes[0].chain_source), nodes[0].tx_broadcaster.clone(), &logger, &fee_estimator, &persister, keys_manager);
387+
new_chain_monitor = test_utils::TestChainMonitor::new(Some(nodes[0].chain_source), nodes[0].tx_broadcaster, &logger, &fee_estimator, &persister, keys_manager);
388388
nodes[0].chain_monitor = &new_chain_monitor;
389389

390390

lightning/src/routing/router.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl Readable for Route {
417417
let blinded_tails = blinded_tails.unwrap_or(Vec::new());
418418
if blinded_tails.len() != 0 {
419419
if blinded_tails.len() != paths.len() { return Err(DecodeError::InvalidValue) }
420-
for (mut path, blinded_tail_opt) in paths.iter_mut().zip(blinded_tails.into_iter()) {
420+
for (path, blinded_tail_opt) in paths.iter_mut().zip(blinded_tails.into_iter()) {
421421
path.blinded_tail = blinded_tail_opt;
422422
}
423423
}
@@ -1221,7 +1221,7 @@ impl<'a> PaymentPath<'a> {
12211221
cur_hop_fees_msat = self.hops.get(i + 1).unwrap().0.hop_use_fee_msat;
12221222
}
12231223

1224-
let mut cur_hop = &mut self.hops.get_mut(i).unwrap().0;
1224+
let cur_hop = &mut self.hops.get_mut(i).unwrap().0;
12251225
cur_hop.next_hops_fee_msat = total_fee_paid_msat;
12261226
// Overpay in fees if we can't save these funds due to htlc_minimum_msat.
12271227
// We try to account for htlc_minimum_msat in scoring (add_entry!), so that nodes don't

0 commit comments

Comments
 (0)