Fix crash when channel short id is not valid

This commit is contained in:
nymkappa
2022-12-06 10:51:01 +01:00
parent adc40e68e2
commit cf08e7cf38
3 changed files with 27 additions and 9 deletions

View File

@@ -208,6 +208,9 @@ class NetworkSyncService {
const channels = await channelsApi.$getChannelsWithoutCreatedDate();
for (const channel of channels) {
const transaction = await fundingTxFetcher.$fetchChannelOpenTx(channel.short_id);
if (!transaction) {
continue;
}
await DB.query(`
UPDATE channels SET created = FROM_UNIXTIME(?) WHERE channels.id = ?`,
[transaction.timestamp, channel.id]