Skip to content

Commit ab8b7aa

Browse files
committed
Add a note clarifying the API guarantees of create_channel
1 parent 25c9f5d commit ab8b7aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channelmanager.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
11091109
///
11101110
/// Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
11111111
/// greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
1112+
///
1113+
/// Note that we do not check if you are currently connected to the given peer. If no
1114+
/// connection is available, the outbound `open_channel` message may fail to send, resulting in
1115+
/// the channel eventually being silently forgotten.
11121116
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> {
11131117
if channel_value_satoshis < 1000 {
11141118
return Err(APIError::APIMisuseError { err: format!("Channel value must be at least 1000 satoshis. It was {}", channel_value_satoshis) });

0 commit comments

Comments
 (0)