Skip to content

Commit 33fa278

Browse files
committed
Do not allow sending HTLCs when the first hop is disconnected
1 parent 8cad2ff commit 33fa278

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ln/channelmanager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,9 @@ impl ChannelManager {
985985
if chan.get_their_node_id() != route.hops.first().unwrap().pubkey {
986986
return Err(HandleError{err: "Node ID mismatch on first hop!", action: None});
987987
}
988+
if !chan.is_live() {
989+
return Err(HandleError{err: "Peer for first hop currently disconnected!", action: None});
990+
}
988991
chan.send_htlc_and_commit(htlc_msat, payment_hash, htlc_cltv, onion_packet)?
989992
};
990993

0 commit comments

Comments
 (0)