Merge pull request #3598 from mempool/nymkappa/scan-closed-channel-no-mempool
Make sure to scan closed channels even if config.MEMPOOL.ENABLE = false
This commit is contained in:
commit
2b559ffcce
@ -269,7 +269,11 @@ class NetworkSyncService {
|
||||
}
|
||||
|
||||
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.`);
|
||||
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);
|
||||
} catch (e) {
|
||||
logger.err(`$scanForClosedChannels() error: ${e instanceof Error ? e.message : e}`, logger.tags.ln);
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"MEMPOOL": {
|
||||
"ENABLED": false,
|
||||
"NETWORK": "mainnet",
|
||||
"BACKEND": "esplora",
|
||||
"HTTP_PORT": 8993,
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"MEMPOOL": {
|
||||
"ENABLED": false,
|
||||
"NETWORK": "signet",
|
||||
"BACKEND": "esplora",
|
||||
"HTTP_PORT": 8991,
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"MEMPOOL": {
|
||||
"ENABLED": false,
|
||||
"NETWORK": "testnet",
|
||||
"BACKEND": "esplora",
|
||||
"HTTP_PORT": 8992,
|
||||
|
Loading…
x
Reference in New Issue
Block a user