Skip to content

Commit 02c54cb

Browse files
committed
wip
1 parent e174f61 commit 02c54cb

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

src/liquidity.rs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,13 @@ where
11961196
amt_to_forward_msat,
11971197
channel_count
11981198
}) => {
1199+
log_info!(
1200+
self.logger,
1201+
"Handling LSPS4 OpenChannel for peer {} (amt_to_forward_msat={}, channel_count={})",
1202+
their_network_key,
1203+
amt_to_forward_msat,
1204+
channel_count,
1205+
);
11991206
if self.liquidity_manager.lsps4_service_handler().is_none() {
12001207
log_error!(self.logger, "Failed to handle LSPS4ServiceEvent as LSPS4 liquidity service was not configured.",);
12011208
return;
@@ -1232,6 +1239,11 @@ where
12321239
log_error!(self.logger, "Failed to handle LSPS4ServiceEvent as peer manager isn't available. This should never happen.",);
12331240
return;
12341241
};
1242+
log_info!(
1243+
self.logger,
1244+
"LSPS4 OpenChannel peer {} is connected; computing channel size",
1245+
their_network_key,
1246+
);
12351247

12361248
// Fail if we have insufficient onchain funds available.
12371249
let over_provisioning_msat = (amt_to_forward_msat
@@ -1284,6 +1296,14 @@ where
12841296
// succeed.
12851297
return;
12861298
}
1299+
log_info!(
1300+
self.logger,
1301+
"LSPS4 OpenChannel peer {} passed funding checks (channel_amount_sats={}, required_funds_sats={}, spendable_amount_sats={})",
1302+
their_network_key,
1303+
channel_amount_sats,
1304+
required_funds_sats,
1305+
spendable_amount_sats,
1306+
);
12871307

12881308
let mut config = self.channel_manager.get_current_config().clone();
12891309

@@ -1307,6 +1327,13 @@ where
13071327

13081328
// TODO: does LSPS4 service need to track this? seems like no?
13091329
let user_channel_id = 0;
1330+
log_info!(
1331+
self.logger,
1332+
"Calling create_channel for LSPS4 peer {} (channel_amount_sats={}, user_channel_id={})",
1333+
their_network_key,
1334+
channel_amount_sats,
1335+
user_channel_id,
1336+
);
13101337

13111338
match self.channel_manager.create_channel(
13121339
their_network_key,
@@ -1316,7 +1343,14 @@ where
13161343
None,
13171344
Some(config),
13181345
) {
1319-
Ok(_) => {},
1346+
Ok(_) => {
1347+
log_info!(
1348+
self.logger,
1349+
"LSPS4 create_channel accepted for peer {} (channel_amount_sats={})",
1350+
their_network_key,
1351+
channel_amount_sats,
1352+
);
1353+
},
13201354
Err(e) => {
13211355
// TODO: We just silently fail here. Eventually we will need to remember
13221356
// the pending requests and regularly retry opening the channel until we

0 commit comments

Comments
 (0)