From: Matt Corallo Date: Sat, 8 Sep 2018 19:53:05 +0000 (-0400) Subject: Do not allow sending HTLCs when the first hop is disconnected X-Git-Tag: v0.0.12~318^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=33fa278f336eb944732dc20936ab09119813b202;p=rust-lightning Do not allow sending HTLCs when the first hop is disconnected --- 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)? };