projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8408b8d
)
Fix build warnings
author
Jeffrey Czyz
<jkczyz@gmail.com>
Fri, 3 Mar 2023 16:54:42 +0000
(10:54 -0600)
committer
Jeffrey Czyz
<jkczyz@gmail.com>
Fri, 3 Mar 2023 20:23:18 +0000
(14:23 -0600)
fuzz/src/full_stack.rs
patch
|
blob
|
history
lightning-background-processor/src/lib.rs
patch
|
blob
|
history
lightning-rapid-gossip-sync/src/processing.rs
patch
|
blob
|
history
lightning/src/ln/channelmanager.rs
patch
|
blob
|
history
lightning/src/ln/outbound_payment.rs
patch
|
blob
|
history
lightning/src/sync/debug_sync.rs
patch
|
blob
|
history
lightning/src/sync/fairrwlock.rs
patch
|
blob
|
history
lightning/src/sync/test_lockorder_checks.rs
patch
|
blob
|
history
diff --git
a/fuzz/src/full_stack.rs
b/fuzz/src/full_stack.rs
index b96de0b9782443f9c4fd72da7b861a2c6727a420..05ae32e4ca0e080348955b51cc7d22dc3e71e66e 100644
(file)
--- a/
fuzz/src/full_stack.rs
+++ b/
fuzz/src/full_stack.rs
@@
-42,7
+42,7
@@
use lightning::ln::msgs::{self, DecodeError};
use lightning::ln::script::ShutdownScript;
use lightning::routing::gossip::{P2PGossipSync, NetworkGraph};
use lightning::routing::utxo::UtxoLookup;
use lightning::ln::script::ShutdownScript;
use lightning::routing::gossip::{P2PGossipSync, NetworkGraph};
use lightning::routing::utxo::UtxoLookup;
-use lightning::routing::router::{find_route, InFlightHtlcs, PaymentParameters, Route, Route
Hop, Route
Parameters, Router};
+use lightning::routing::router::{find_route, InFlightHtlcs, PaymentParameters, Route, RouteParameters, Router};
use lightning::routing::scoring::FixedPenaltyScorer;
use lightning::util::config::UserConfig;
use lightning::util::errors::APIError;
use lightning::routing::scoring::FixedPenaltyScorer;
use lightning::util::config::UserConfig;
use lightning::util::errors::APIError;
diff --git
a/lightning-background-processor/src/lib.rs
b/lightning-background-processor/src/lib.rs
index f7f1296b98e66e737c6c81283a8a7e459a7b8160..a6de0a62fb07583ae29741b87d209c0e66ee7c5d 100644
(file)
--- a/
lightning-background-processor/src/lib.rs
+++ b/
lightning-background-processor/src/lib.rs
@@
-33,7
+33,9
@@
use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
use lightning::routing::utxo::UtxoLookup;
use lightning::routing::router::Router;
use lightning::routing::scoring::{Score, WriteableScore};
use lightning::routing::utxo::UtxoLookup;
use lightning::routing::router::Router;
use lightning::routing::scoring::{Score, WriteableScore};
-use lightning::util::events::{Event, EventHandler, EventsProvider, PathFailure};
+use lightning::util::events::{Event, PathFailure};
+#[cfg(feature = "std")]
+use lightning::util::events::{EventHandler, EventsProvider};
use lightning::util::logger::Logger;
use lightning::util::persist::Persister;
use lightning_rapid_gossip_sync::RapidGossipSync;
use lightning::util::logger::Logger;
use lightning::util::persist::Persister;
use lightning_rapid_gossip_sync::RapidGossipSync;
diff --git
a/lightning-rapid-gossip-sync/src/processing.rs
b/lightning-rapid-gossip-sync/src/processing.rs
index 8a52d234388052a38b540bfa30a6621387007ec5..8d36dfe38844f75d189e4c27896b3f3a4d3e4891 100644
(file)
--- a/
lightning-rapid-gossip-sync/src/processing.rs
+++ b/
lightning-rapid-gossip-sync/src/processing.rs
@@
-42,7
+42,7
@@
impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
&self,
read_cursor: &mut R,
) -> Result<u32, GraphSyncError> {
&self,
read_cursor: &mut R,
) -> Result<u32, GraphSyncError> {
- #[allow(unused_mut)]
+ #[allow(unused_mut
, unused_assignments
)]
let mut current_time_unix = None;
#[cfg(all(feature = "std", not(test)))]
{
let mut current_time_unix = None;
#[cfg(all(feature = "std", not(test)))]
{
diff --git
a/lightning/src/ln/channelmanager.rs
b/lightning/src/ln/channelmanager.rs
index ee438f36fe79e4eb6dd91aa27911c3cc6d57f878..bceae0f8b349ae322d0b7162a8384927dbd94e4c 100644
(file)
--- a/
lightning/src/ln/channelmanager.rs
+++ b/
lightning/src/ln/channelmanager.rs
@@
-3982,7
+3982,7
@@
where
None => None
};
None => None
};
- let
mut
peer_state_opt = counterparty_node_id_opt.as_ref().map(
+ let peer_state_opt = counterparty_node_id_opt.as_ref().map(
|counterparty_node_id| per_peer_state.get(counterparty_node_id).map(
|peer_mutex| peer_mutex.lock().unwrap()
)
|counterparty_node_id| per_peer_state.get(counterparty_node_id).map(
|peer_mutex| peer_mutex.lock().unwrap()
)
diff --git
a/lightning/src/ln/outbound_payment.rs
b/lightning/src/ln/outbound_payment.rs
index 33ccecb4ca858b17c45321b3a17c2303e6931587..86b4de768f830172d1caf411b5670667be60923e 100644
(file)
--- a/
lightning/src/ln/outbound_payment.rs
+++ b/
lightning/src/ln/outbound_payment.rs
@@
-276,7
+276,11
@@
pub(crate) struct PaymentAttemptsUsingTime<T: Time> {
/// it means the result of the first attempt is not known yet.
pub(crate) count: usize,
/// This field is only used when retry is `Retry::Timeout` which is only build with feature std
/// it means the result of the first attempt is not known yet.
pub(crate) count: usize,
/// This field is only used when retry is `Retry::Timeout` which is only build with feature std
- first_attempted_at: T
+ #[cfg(not(feature = "no-std"))]
+ first_attempted_at: T,
+ #[cfg(feature = "no-std")]
+ phantom: core::marker::PhantomData<T>,
+
}
#[cfg(not(any(feature = "no-std", test)))]
}
#[cfg(not(any(feature = "no-std", test)))]
@@
-290,7
+294,10
@@
impl<T: Time> PaymentAttemptsUsingTime<T> {
pub(crate) fn new() -> Self {
PaymentAttemptsUsingTime {
count: 0,
pub(crate) fn new() -> Self {
PaymentAttemptsUsingTime {
count: 0,
- first_attempted_at: T::now()
+ #[cfg(not(feature = "no-std"))]
+ first_attempted_at: T::now(),
+ #[cfg(feature = "no-std")]
+ phantom: core::marker::PhantomData,
}
}
}
}
}
}
diff --git
a/lightning/src/sync/debug_sync.rs
b/lightning/src/sync/debug_sync.rs
index 5b6acbcadd5bf38686f8ec43dc761eae6a9e3ba1..7ea1693b87095260cc6251f256caf0c4790610ff 100644
(file)
--- a/
lightning/src/sync/debug_sync.rs
+++ b/
lightning/src/sync/debug_sync.rs
@@
-129,7
+129,7
@@
impl LockMetadata {
// For each lock which is currently locked, check that no lock's locked-before
// set includes the lock we're about to lock, which would imply a lockorder
// inversion.
// For each lock which is currently locked, check that no lock's locked-before
// set includes the lock we're about to lock, which would imply a lockorder
// inversion.
- for (locked_idx, locked) in held.borrow().iter() {
+ for (locked_idx,
_
locked) in held.borrow().iter() {
if *locked_idx == this.lock_idx {
// Note that with `feature = "backtrace"` set, we may be looking at different
// instances of the same lock. Still, doing so is quite risky, a total order
if *locked_idx == this.lock_idx {
// Note that with `feature = "backtrace"` set, we may be looking at different
// instances of the same lock. Still, doing so is quite risky, a total order
@@
-143,7
+143,7
@@
impl LockMetadata {
panic!("Tried to acquire a lock while it was held!");
}
}
panic!("Tried to acquire a lock while it was held!");
}
}
- for (locked_idx, locked) in held.borrow().iter() {
+ for (
_
locked_idx, locked) in held.borrow().iter() {
for (locked_dep_idx, _locked_dep) in locked.locked_before.lock().unwrap().iter() {
if *locked_dep_idx == this.lock_idx && *locked_dep_idx != locked.lock_idx {
#[cfg(feature = "backtrace")]
for (locked_dep_idx, _locked_dep) in locked.locked_before.lock().unwrap().iter() {
if *locked_dep_idx == this.lock_idx && *locked_dep_idx != locked.lock_idx {
#[cfg(feature = "backtrace")]
diff --git
a/lightning/src/sync/fairrwlock.rs
b/lightning/src/sync/fairrwlock.rs
index de609d5b3d711059568daca1e9d408be80891321..23b8c23db282b20ad5c90d3fc937e367e6b6dac6 100644
(file)
--- a/
lightning/src/sync/fairrwlock.rs
+++ b/
lightning/src/sync/fairrwlock.rs
@@
-45,6
+45,7
@@
impl<T> FairRwLock<T> {
self.lock.read()
}
self.lock.read()
}
+ #[allow(dead_code)]
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<'_, T>> {
self.lock.try_write()
}
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<'_, T>> {
self.lock.try_write()
}
diff --git
a/lightning/src/sync/test_lockorder_checks.rs
b/lightning/src/sync/test_lockorder_checks.rs
index 6d72410bd596341fd5246760f03046884b93e3b5..96e497d44392985cd33b31f873751b0cc030f1d6 100644
(file)
--- a/
lightning/src/sync/test_lockorder_checks.rs
+++ b/
lightning/src/sync/test_lockorder_checks.rs
@@
-3,7
+3,6
@@
use crate::sync::debug_sync::{RwLock, Mutex};
use super::{LockHeldState, LockTestExt};
use std::sync::Arc;
use super::{LockHeldState, LockTestExt};
use std::sync::Arc;
-use std::thread;
#[test]
#[should_panic]
#[test]
#[should_panic]