Merge branch 'master' into mononaut/difficulty-updates

This commit is contained in:
wiz 2023-07-12 16:45:03 +09:00 committed by GitHub
commit 4144746e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import logger from './logger';
import bitcoinClient from './api/bitcoin/bitcoin-client';
import priceUpdater from './tasks/price-updater';
import PricesRepository from './repositories/PricesRepository';
import config from './config';
export interface CoreIndex {
name: string;
@ -72,7 +73,7 @@ class Indexer {
return;
}
if (task === 'blocksPrices' && !this.tasksRunning.includes(task)) {
if (task === 'blocksPrices' && !this.tasksRunning.includes(task) && !['testnet', 'signet'].includes(config.MEMPOOL.NETWORK)) {
this.tasksRunning.push(task);
const lastestPriceId = await PricesRepository.$getLatestPriceId();
if (priceUpdater.historyInserted === false || lastestPriceId === null) {

View File

@ -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);

View File

@ -1,3 +1,3 @@
<span [style]="change >= 0 ? 'color: #42B747' : 'color: #B74242'">
{{ change >= 0 ? '+' : '' }}{{ change | amountShortener }}%
&lrm;{{ change >= 0 ? '+' : '' }}{{ change | amountShortener }}%
</span>

View File

@ -993,6 +993,10 @@ th {
margin-right: 10px;
}
}
.btn-audit {
margin-left: .5em;
}
}
.scriptmessage {

View File

@ -1,5 +1,6 @@
{
"MEMPOOL": {
"ENABLED": false,
"NETWORK": "mainnet",
"BACKEND": "esplora",
"HTTP_PORT": 8993,

View File

@ -1,5 +1,6 @@
{
"MEMPOOL": {
"ENABLED": false,
"NETWORK": "signet",
"BACKEND": "esplora",
"HTTP_PORT": 8991,

View File

@ -1,5 +1,6 @@
{
"MEMPOOL": {
"ENABLED": false,
"NETWORK": "testnet",
"BACKEND": "esplora",
"HTTP_PORT": 8992,