mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-17 21:31:42 +01:00
This commit is contained in:
parent
d1ecffdea3
commit
2cc60777d5
@ -71,7 +71,13 @@ export class StratumV1Client extends EasyUnsubscribe {
|
||||
data.toString()
|
||||
.split('\n')
|
||||
.filter(m => m.length > 0)
|
||||
.forEach(m => this.handleMessage(m))
|
||||
.forEach(async (m) => {
|
||||
try {
|
||||
await this.handleMessage(m);
|
||||
} catch (e) {
|
||||
this.promiseSocket.socket.emit('end', true);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@ -425,7 +431,11 @@ export class StratumV1Client extends EasyUnsubscribe {
|
||||
'Difficulty too low').response();
|
||||
console.error(err);
|
||||
console.log(`Header: ${header.toString('hex')}`);
|
||||
await this.promiseSocket.write(err);
|
||||
try {
|
||||
await this.promiseSocket.write(err);
|
||||
} catch (e) {
|
||||
this.promiseSocket.socket.emit('end', true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user