Make sure to scan closed channels even if config.MEMPOOL.ENABLE = false
This commit is contained in:
parent
5977251a20
commit
c675d1c498
@ -269,7 +269,11 @@ class NetworkSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async $scanForClosedChannels(): Promise<void> {
|
private async $scanForClosedChannels(): Promise<void> {
|
||||||
if (this.closedChannelsScanBlock === blocks.getCurrentBlockHeight()) {
|
let currentBlockHeight = blocks.getCurrentBlockHeight();
|
||||||
|
if (config.MEMPOOL.ENABLED === false) { // https://github.com/mempool/mempool/issues/3582
|
||||||
|
currentBlockHeight = await bitcoinApi.$getBlockHeightTip();
|
||||||
|
}
|
||||||
|
if (this.closedChannelsScanBlock === currentBlockHeight) {
|
||||||
logger.debug(`We've already scan closed channels for this block, skipping.`);
|
logger.debug(`We've already scan closed channels for this block, skipping.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -305,7 +309,7 @@ class NetworkSyncService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.closedChannelsScanBlock = blocks.getCurrentBlockHeight();
|
this.closedChannelsScanBlock = currentBlockHeight;
|
||||||
logger.debug(`Closed channels scan completed at block ${this.closedChannelsScanBlock}`, logger.tags.ln);
|
logger.debug(`Closed channels scan completed at block ${this.closedChannelsScanBlock}`, logger.tags.ln);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.err(`$scanForClosedChannels() error: ${e instanceof Error ? e.message : e}`, logger.tags.ln);
|
logger.err(`$scanForClosedChannels() error: ${e instanceof Error ? e.message : e}`, logger.tags.ln);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user