Convert to short_id before fetching the funding tx

This commit is contained in:
nymkappa 2022-08-09 09:21:31 +02:00
parent 47363b477e
commit abb078f7ee
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -1,5 +1,6 @@
import { existsSync, promises } from 'fs';
import bitcoinClient from '../../../api/bitcoin/bitcoin-client';
import { Common } from '../../../api/common';
import config from '../../../config';
import logger from '../../../logger';
@ -70,6 +71,10 @@ class FundingTxFetcher {
}
public async $fetchChannelOpenTx(channelId: string): Promise<{timestamp: number, txid: string, value: number}> {
if (channelId.indexOf('x') === -1) {
channelId = Common.channelIntegerIdToShortId(channelId);
}
if (this.fundingTxCache[channelId]) {
return this.fundingTxCache[channelId];
}