Closed tvolk131 closed 4 months ago
You can have two channels from two different nodes with the same channel id (before the funding step completes), so this isn't generally safe, sadly.
I need to be able to close a channel solely by its channel ID. Currently I call
Node::list_channels()
, filter by channel ID, then get theChannelDetails.counterparty_node_id
for the channel. Could we bake this behavior intoNode::close_channel()
?
Note that we recently changed the signature to take a UserChannelId
rather than the channel ID (besides others also for the reasons Matt mentioned). Since this is expected to be a unique identifier, I guess we could technically drop the counterparty_node_id
now. However, from the perspective of providing a failsafe API I generally like that we require the user to provide the counterparty also.
@tvolk131 Would you benefit from dropping counterparty_node_id
at all now that we require a UserChannelId
, or would you'd have to look up the latter from the channel id anyways?
Thanks for the explanation! I actually no longer need to be able to close a channel solely by its channel ID. The API currently provided will work just fine for my use-case. I'll go ahead and close this out.
I need to be able to close a channel solely by its channel ID. Currently I call
Node::list_channels()
, filter by channel ID, then get theChannelDetails.counterparty_node_id
for the channel. Could we bake this behavior intoNode::close_channel()
?