Skip to content

Commit edc62b6

Browse files
committed
Add a note clarifying the API guarantees of create_channel
1 parent 8856112 commit edc62b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
11281128
///
11291129
/// Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
11301130
/// greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
1131+
///
1132+
/// Note that we do not check if you are currently connected to the given peer. If no
1133+
/// connection is available, the outbound `open_channel` message may fail to send, resulting in
1134+
/// the channel eventually being silently forgotten.
11311135
pub fn create_channel(&self, their_network_key: PublicKey, channel_value_satoshis: u64, push_msat: u64, user_id: u64, override_config: Option<UserConfig>) -> Result<(), APIError> {
11321136
if channel_value_satoshis < 1000 {
11331137
return Err(APIError::APIMisuseError { err: format!("Channel value must be at least 1000 satoshis. It was {}", channel_value_satoshis) });

0 commit comments

Comments
 (0)