Skip to content

Commit d630365

Browse files
committed
Update docs on open{_announced}_channel
1 parent 81c36d4 commit d630365

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/lib.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,10 +1186,6 @@ impl Node {
11861186
Ok(())
11871187
}
11881188

1189-
/// Connect to a node and open a new channel.
1190-
///
1191-
/// See [`Node::open_channel`] or [`Node::open_announced_channel`] for more information about
1192-
/// parameters.
11931189
fn open_channel_inner(
11941190
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
11951191
push_to_counterparty_msat: Option<u64>, channel_config: Option<ChannelConfig>,
@@ -1293,7 +1289,9 @@ impl Node {
12931289
}
12941290
}
12951291

1296-
/// Connect to a node and open a new channel.
1292+
/// Connect to a node and open a new unannounced channel.
1293+
///
1294+
/// To open an announced channel, see [`Node::open_announced_channel`].
12971295
///
12981296
/// Disconnects and reconnects are handled automatically.
12991297
///
@@ -1305,8 +1303,6 @@ impl Node {
13051303
/// [`AnchorChannelsConfig::per_channel_reserve_sats`] is available and will be retained before
13061304
/// opening the channel.
13071305
///
1308-
/// Calls `Node::open_channel_inner` with `announce_channel` set to `false`.
1309-
///
13101306
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
13111307
pub fn open_channel(
13121308
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
@@ -1324,6 +1320,12 @@ impl Node {
13241320

13251321
/// Connect to a node and open a new announced channel.
13261322
///
1323+
/// This will return an error if the node has not been sufficiently configured to operate as a
1324+
/// forwarding node that can properly announce its existence to the publip network graph, i.e.,
1325+
/// [`Config::listening_addresses`] and [`Config::node_alias`] are unset.
1326+
///
1327+
/// To open an unannounced channel, see [`Node::open_channel`].
1328+
///
13271329
/// Disconnects and reconnects are handled automatically.
13281330
///
13291331
/// If `push_to_counterparty_msat` is set, the given value will be pushed (read: sent) to the
@@ -1334,12 +1336,6 @@ impl Node {
13341336
/// [`AnchorChannelsConfig::per_channel_reserve_sats`] is available and will be retained before
13351337
/// opening the channel.
13361338
///
1337-
/// Note that, regardless of the value of `announce_channel` passed, this function
1338-
/// checks that a node is configured to announce the channel to be openned and returns
1339-
/// an error if the configuration is wrong. Otherwise, calls `Node::open_channel_inner`
1340-
/// with `announced_channel` equals to `true`.
1341-
/// See `config::can_announce_channel` for more details.
1342-
///
13431339
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
13441340
pub fn open_announced_channel(
13451341
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,

0 commit comments

Comments
 (0)