use lightning::ln::msgs::{self, DecodeError};
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::scoring::FixedPenaltyScorer;
use lightning::util::config::UserConfig;
action: msgs::ErrorAction::IgnoreError
})
}
- fn notify_payment_path_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
- fn notify_payment_path_successful(&self, _path: &[&RouteHop]) {}
- fn notify_payment_probe_successful(&self, _path: &[&RouteHop]) {}
- fn notify_payment_probe_failed(&self, _path: &[&RouteHop], _short_channel_id: u64) {}
}
struct TestBroadcaster {
type ChannelMan<'a> = ChannelManager<
Arc<chainmonitor::ChainMonitor<EnforcingSigner, Arc<dyn chain::Filter>, Arc<TestBroadcaster>, Arc<FuzzEstimator>, Arc<dyn Logger>, Arc<TestPersister>>>,
Arc<TestBroadcaster>, Arc<KeyProvider>, Arc<KeyProvider>, Arc<KeyProvider>, Arc<FuzzEstimator>, &'a FuzzRouter, Arc<dyn Logger>>;
-type PeerMan<'a> = PeerManager<Peer<'a>, Arc<ChannelMan<'a>>, Arc<P2PGossipSync<Arc<NetworkGraph<Arc<dyn Logger>>>, Arc<dyn chain::Access>, Arc<dyn Logger>>>, IgnoringMessageHandler, Arc<dyn Logger>, IgnoringMessageHandler, Arc<KeyProvider>>;
+type PeerMan<'a> = PeerManager<Peer<'a>, Arc<ChannelMan<'a>>, Arc<P2PGossipSync<Arc<NetworkGraph<Arc<dyn Logger>>>, Arc<dyn UtxoLookup>, Arc<dyn Logger>>>, IgnoringMessageHandler, Arc<dyn Logger>, IgnoringMessageHandler, Arc<KeyProvider>>;
struct MoneyLossDetector<'a> {
manager: Arc<ChannelMan<'a>>,
},
4 => {
let final_value_msat = slice_to_be24(get_slice!(3)) as u64;
- let payment_params = PaymentParameters::from_node_id(get_pubkey!());
+ let payment_params = PaymentParameters::from_node_id(get_pubkey!(), 42);
let params = RouteParameters {
payment_params,
final_value_msat,
},
15 => {
let final_value_msat = slice_to_be24(get_slice!(3)) as u64;
- let payment_params = PaymentParameters::from_node_id(get_pubkey!());
+ let payment_params = PaymentParameters::from_node_id(get_pubkey!(), 42);
let params = RouteParameters {
payment_params,
final_value_msat,
let payment_hash = PaymentHash(Sha256::from_engine(sha).into_inner());
// Note that this may fail - our hashes may collide and we'll end up trying to
// double-register the same payment_hash.
- let _ = channelmanager.create_inbound_payment_for_hash(payment_hash, None, 1);
+ let _ = channelmanager.create_inbound_payment_for_hash(payment_hash, None, 1, None);
},
9 => {
for payment in payments_received.drain(..) {
if let Err(e) = channelmanager.funding_transaction_generated(&funding_generation.0, &funding_generation.1, tx.clone()) {
// It's possible the channel has been closed in the mean time, but any other
// failure may be a bug.
- if let APIError::ChannelUnavailable { err } = e {
- if !err.starts_with("Can't find a peer matching the passed counterparty node_id ") {
- assert_eq!(err, "No such channel");
- }
- } else { panic!(); }
+ if let APIError::ChannelUnavailable { .. } = e { } else { panic!(); }
}
pending_funding_signatures.insert(funding_output, tx);
}