Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 3ad65f8

Browse files
committed
feat: append channel monitor details to lsp log
1 parent c42e73e commit 3ad65f8

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

lib/src/lightning-manager.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import {
5757
IAddress,
5858
TLspLogPayload,
5959
TLspLogEvent,
60+
TChannelMonitor,
6061
} from './utils/types';
6162
import {
6263
appendPath,
@@ -2248,14 +2249,23 @@ class LightningManager {
22482249
await this.syncLdk();
22492250
}
22502251

2251-
private async onLspLogEvent(payload: any): Promise<void> {
2252+
private async onLspLogEvent(payload: object): Promise<void> {
22522253
if (!this.lspLogEvent) {
22532254
return;
22542255
}
2256+
let body: { channelClose: object; channelFiles: TChannelMonitor[] } = {
2257+
channelClose: payload,
2258+
channelFiles: [],
2259+
};
22552260
const nodeIdRes = await ldk.nodeId();
22562261

2262+
const channelFiles = await ldk.listChannelMonitors(true);
2263+
if (channelFiles.isOk()) {
2264+
body.channelFiles = channelFiles.value;
2265+
}
2266+
22572267
await this.lspLogEvent({
2258-
body: JSON.stringify(payload),
2268+
body: JSON.stringify(body),
22592269
nodeId: nodeIdRes.isOk() ? nodeIdRes.value : '',
22602270
});
22612271
}

0 commit comments

Comments
 (0)