mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
logging
This commit is contained in:
@@ -77,7 +77,7 @@ export class ClientStatisticsService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.clientStatisticsRepository.query(query);
|
await this.clientStatisticsRepository.query(query);
|
||||||
console.log(`Bulk updated ${this.bulkAsyncUpdates.length} statistics`)
|
//console.log(`Bulk updated ${this.bulkAsyncUpdates.length} statistics`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Bulk update failed:', error.message, query);
|
console.error('Bulk update failed:', error.message, query);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export class BitcoinRpcService implements OnModuleInit {
|
|||||||
console.log(`MASTER? ${process.env.MASTER}`)
|
console.log(`MASTER? ${process.env.MASTER}`)
|
||||||
if (process.env.MASTER != 'true') {
|
if (process.env.MASTER != 'true') {
|
||||||
this.pubsubInstance.addChannel('miningInfo', async (miningInfo: IMiningInfo) => {
|
this.pubsubInstance.addChannel('miningInfo', async (miningInfo: IMiningInfo) => {
|
||||||
console.log('PG Sub. new template');
|
//console.log('PG Sub. new template');
|
||||||
this.miningInfo = miningInfo;
|
this.miningInfo = miningInfo;
|
||||||
const savedBlockTemplate = await this.rpcBlockService.getSavedBlockTemplate(miningInfo.blocks);
|
const savedBlockTemplate = await this.rpcBlockService.getSavedBlockTemplate(miningInfo.blocks);
|
||||||
this._newBlockTemplate$.next(JSON.parse(savedBlockTemplate.data));
|
this._newBlockTemplate$.next(JSON.parse(savedBlockTemplate.data));
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ export class StratumV1JobsService {
|
|||||||
this.newMiningJob$ = this.bitcoinRpcService.newBlockTemplate$.pipe(
|
this.newMiningJob$ = this.bitcoinRpcService.newBlockTemplate$.pipe(
|
||||||
map((blockTemplate) => {
|
map((blockTemplate) => {
|
||||||
|
|
||||||
console.log('Updating block template');
|
if (process.env.MASTER == 'true') {
|
||||||
|
console.log('Updating block template');
|
||||||
|
}
|
||||||
|
|
||||||
let clearJobs = false;
|
let clearJobs = false;
|
||||||
const currentBlockHeight = this.bitcoinRpcService.miningInfo.blocks;
|
const currentBlockHeight = this.bitcoinRpcService.miningInfo.blocks;
|
||||||
@@ -128,7 +130,7 @@ export class StratumV1JobsService {
|
|||||||
jobsDeleted++;
|
jobsDeleted++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(`Deleted ${templatesDeleted} templates and ${jobsDeleted} jobs.`)
|
//console.log(`Deleted ${templatesDeleted} templates and ${jobsDeleted} jobs.`)
|
||||||
}
|
}
|
||||||
this.blocks[data.blockData.id] = data;
|
this.blocks[data.blockData.id] = data;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user