mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user