Skip to content

Commit ec6d9a7

Browse files
authored
Merge pull request lightningdevkit#4160 from wvanlint/unknown_scid
Return an error when the intercept SCID is unknown to the LSPS2 service
2 parents b6607a7 + 1d2b0ed commit ec6d9a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lightning-liquidity/src/lsps2/service.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ where
981981
/// Will generate a [`LSPS2ServiceEvent::OpenChannel`] event if the intercept scid matches a payment we are expected
982982
/// and the payment amount is correct and the offer has not expired.
983983
///
984-
/// Will do nothing if the intercept scid does not match any of the ones we gave out.
984+
/// Will return an error if the intercept scid does not match any of the ones we gave out.
985985
///
986986
/// [`Event::HTLCIntercepted`]: lightning::events::Event::HTLCIntercepted
987987
/// [`LSPS2ServiceEvent::OpenChannel`]: crate::lsps2::event::LSPS2ServiceEvent::OpenChannel
@@ -1067,6 +1067,10 @@ where
10671067
});
10681068
},
10691069
}
1070+
} else {
1071+
return Err(APIError::APIMisuseError {
1072+
err: format!("Unknown scid provided: {}", intercept_scid),
1073+
});
10701074
}
10711075

10721076
if let Some(counterparty_node_id) = should_persist {

0 commit comments

Comments
 (0)