This commit is contained in:
Benjamin Wilson
2024-09-16 19:39:56 -04:00
parent 88e7f5f3fb
commit 4928f34daf
4 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export class RpcBlockService {
}
public saveBlock(blockHeight: number, data: string) {
return this.rpcBlockRepository.update(blockHeight, { data })
return this.rpcBlockRepository.update(blockHeight, { data });
}
public async deleteOldBlocks() {
+1 -1
View File
@@ -143,7 +143,7 @@ export class StratumV1Client {
this.sessionStart = new Date();
this.statistics = new StratumV1ClientStatistics(this.clientStatisticsService);
this.extraNonceAndSessionId = this.getRandomHexString();
console.log(`New client ID: : ${this.extraNonceAndSessionId}, ${this.socket.remoteAddress}:${this.socket.remotePort}`);
//console.log(`New client ID: : ${this.extraNonceAndSessionId}, ${this.socket.remoteAddress}:${this.socket.remotePort}`);
}
this.clientSubscription = subscriptionMessage;
+6 -1
View File
@@ -134,7 +134,12 @@ export class BitcoinRpcService implements OnModuleInit {
try{
console.log(`Saving block ${blockHeight}`);
await this.rpcBlockService.saveBlock(blockHeight, JSON.stringify(blockTemplate));
const result = await this.rpcBlockService.saveBlock(blockHeight, JSON.stringify(blockTemplate));
if(result.affected < 1){
console.error('Block was not saved');
}else {
console.log('block saved');
}
}catch(e){
console.error('Error saving block', e);
+1 -1
View File
@@ -64,7 +64,7 @@ export class StratumV1Service implements OnModuleInit {
if (client.extraNonceAndSessionId != null) {
// Handle socket disconnection
await client.destroy();
console.log(`Client ${client.extraNonceAndSessionId} disconnected, hadError?:${hadError}`);
//console.log(`Client ${client.extraNonceAndSessionId} disconnected, hadError?:${hadError}`);
}
});