Skip to content

Commit dabbb4d

Browse files
committed
Have connect_open_channel return a UserChannelId
1 parent 2e4936f commit dabbb4d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bindings/ldk_node.udl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ interface LDKNode {
6363
[Throws=NodeError]
6464
void disconnect(PublicKey node_id);
6565
[Throws=NodeError]
66-
void connect_open_channel(PublicKey node_id, SocketAddress address, u64 channel_amount_sats, u64? push_to_counterparty_msat, ChannelConfig? channel_config, boolean announce_channel);
66+
UserChannelId connect_open_channel(PublicKey node_id, SocketAddress address, u64 channel_amount_sats, u64? push_to_counterparty_msat, ChannelConfig? channel_config, boolean announce_channel);
6767
[Throws=NodeError]
6868
void close_channel([ByRef]ChannelId channel_id, PublicKey counterparty_node_id);
6969
[Throws=NodeError]

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,12 +969,12 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
969969
/// channel counterparty on channel open. This can be useful to start out with the balance not
970970
/// entirely shifted to one side, therefore allowing to receive payments from the getgo.
971971
///
972-
/// Returns a temporary channel id.
972+
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
973973
pub fn connect_open_channel(
974974
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
975975
push_to_counterparty_msat: Option<u64>, channel_config: Option<Arc<ChannelConfig>>,
976976
announce_channel: bool,
977-
) -> Result<(), Error> {
977+
) -> Result<UserChannelId, Error> {
978978
let rt_lock = self.runtime.read().unwrap();
979979
if rt_lock.is_none() {
980980
return Err(Error::NotRunning);
@@ -1031,7 +1031,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
10311031
peer_info.node_id
10321032
);
10331033
self.peer_store.add_peer(peer_info)?;
1034-
Ok(())
1034+
Ok(UserChannelId(user_channel_id))
10351035
}
10361036
Err(e) => {
10371037
log_error!(self.logger, "Failed to initiate channel creation: {:?}", e);

0 commit comments

Comments
 (0)