X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-sample;a=blobdiff_plain;f=src%2Fmain.rs;fp=src%2Fmain.rs;h=a33d667653291169fa87cc7eeed9faaa62580ced;hp=50edb22ed54449d47d1f168c252ab05ff0ff7a6a;hb=aa1635c16624664ba2fde72c0f58da7437e50b74;hpb=7ef8932dc19e21ba2be0903d7a174d27de3f1989 diff --git a/src/main.rs b/src/main.rs index 50edb22..a33d667 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,7 +139,7 @@ pub(crate) type GossipVerifier = lightning_block_sync::gossip::GossipVerifier< Arc, SocketDescriptor, Arc, - Arc>, + Arc, IgnoringMessageHandler, Arc, >; @@ -158,7 +158,8 @@ pub(crate) type ChannelManager = pub(crate) type NetworkGraph = gossip::NetworkGraph>; -type OnionMessenger = SimpleArcOnionMessenger; +type OnionMessenger = + SimpleArcOnionMessenger; pub(crate) type BumpTxEventHandler = BumpTransactionEventHandler< Arc, @@ -358,6 +359,13 @@ async fn handle_ldk_events( } fs_store.write("", "", OUTBOUND_PAYMENTS_FNAME, &outbound.encode()).unwrap(); } + Event::InvoiceRequestFailed { payment_id } => { + print!("\nEVENT: Failed to request invoice to send payment with id {}", payment_id); + print!("> "); + io::stdout().flush().unwrap(); + + // TODO: mark the payment as failed + } Event::PaymentForwarded { prev_channel_id, next_channel_id, @@ -754,7 +762,7 @@ async fn start_ldk() { Arc::clone(&keys_manager), Arc::clone(&logger), Arc::new(DefaultMessageRouter {}), - IgnoringMessageHandler {}, + Arc::clone(&channel_manager), IgnoringMessageHandler {}, )); let mut ephemeral_bytes = [0; 32];