Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow collab-closing legacy Lightning channels #1914

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions coordinator/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,16 +602,22 @@ pub async fn delete_dlc_channels(
}

#[instrument(skip_all, err(Debug))]
pub async fn force_close_ln_dlc_channel(
pub async fn close_ln_dlc_channel(
Path(channel_id_string): Path<String>,
Query(params): Query<CloseChannelParams>,
State(state): State<Arc<AppState>>,
) -> Result<(), AppError> {
let channel_id = parse_channel_id(&channel_id_string)
.map_err(|_| AppError::BadRequest("Provided channel ID was invalid".to_string()))?;

tracing::info!(channel_id = %channel_id_string, "Attempting to force-close Lightning channel");
let is_force_close = params.force.unwrap_or(false);

tracing::info!(
channel_id = %channel_id_string,
%is_force_close,
"Attempting to close an LN-DLC channel"
);

let is_force_close = true;
state
.node
.inner
Expand Down
4 changes: 2 additions & 2 deletions coordinator/src/routes.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::admin::close_channel;
use crate::admin::close_ln_dlc_channel;
use crate::admin::collaborative_revert;
use crate::admin::connect_to_peer;
use crate::admin::delete_dlc_channels;
use crate::admin::force_close_ln_dlc_channel;
use crate::admin::get_balance;
use crate::admin::get_fee_rate_estimation;
use crate::admin::get_utxos;
Expand Down Expand Up @@ -160,7 +160,7 @@ pub fn router(
.route("/api/admin/channels/:channel_id", delete(close_channel))
.route(
"/api/admin/ln-dlc-channels/:channel_id",
delete(force_close_ln_dlc_channel),
delete(close_ln_dlc_channel),
)
.route("/api/admin/peers", get(list_peers))
.route("/api/admin/send_payment/:invoice", post(send_payment))
Expand Down
Loading