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, RouteHop, RouteParameters, 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::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;
&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)))]
{
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()
)
/// 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)))]
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,
}
}
}
// 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
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")]
self.lock.read()
}
+ #[allow(dead_code)]
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<'_, T>> {
self.lock.try_write()
}
use super::{LockHeldState, LockTestExt};
use std::sync::Arc;
-use std::thread;
#[test]
#[should_panic]