Handle database disabled config when running Liquid

fixes #962
This commit is contained in:
softsimon 2021-11-30 10:59:10 +04:00
parent 9a39d3207f
commit feb8e35ec3
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -143,7 +143,7 @@ class Server {
if (this.wss) { if (this.wss) {
websocketHandler.setWebsocketServer(this.wss); websocketHandler.setWebsocketServer(this.wss);
} }
if (config.MEMPOOL.NETWORK === 'liquid') { if (config.MEMPOOL.NETWORK === 'liquid' && config.DATABASE.ENABLED) {
blocks.setNewBlockCallback(async () => { blocks.setNewBlockCallback(async () => {
try { try {
await elementsParser.$parse(); await elementsParser.$parse();
@ -270,7 +270,7 @@ class Server {
; ;
} }
if (config.MEMPOOL.NETWORK === 'liquid') { if (config.MEMPOOL.NETWORK === 'liquid' && config.DATABASE.ENABLED) {
this.app this.app
.get(config.MEMPOOL.API_URL_PREFIX + 'liquid/pegs/month', routes.$getElementsPegsByMonth) .get(config.MEMPOOL.API_URL_PREFIX + 'liquid/pegs/month', routes.$getElementsPegsByMonth)
; ;