mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 02:11:49 +01:00
Fix database usage when database is disabled
This commit is contained in:
parent
f6800b848a
commit
761edbce9a
@ -600,9 +600,11 @@ class Blocks {
|
||||
* Index a block if it's missing from the database. Returns the block after indexing
|
||||
*/
|
||||
public async $indexBlock(height: number): Promise<BlockExtended> {
|
||||
const dbBlock = await blocksRepository.$getBlockByHeight(height);
|
||||
if (dbBlock != null) {
|
||||
return prepareBlock(dbBlock);
|
||||
if (Common.indexingEnabled()) {
|
||||
const dbBlock = await blocksRepository.$getBlockByHeight(height);
|
||||
if (dbBlock !== null) {
|
||||
return prepareBlock(dbBlock);
|
||||
}
|
||||
}
|
||||
|
||||
const blockHash = await bitcoinApi.$getBlockHash(height);
|
||||
|
Loading…
Reference in New Issue
Block a user