From 33fa278f336eb944732dc20936ab09119813b202 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 8 Sep 2018 15:53:05 -0400 Subject: [PATCH] Do not allow sending HTLCs when the first hop is disconnected --- src/ln/channelmanager.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index 4bcd35bc5..baf211fdb 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -985,6 +985,9 @@ impl ChannelManager { if chan.get_their_node_id() != route.hops.first().unwrap().pubkey { return Err(HandleError{err: "Node ID mismatch on first hop!", action: None}); } + if !chan.is_live() { + return Err(HandleError{err: "Peer for first hop currently disconnected!", action: None}); + } chan.send_htlc_and_commit(htlc_msat, payment_hash, htlc_cltv, onion_packet)? }; -- 2.39.5