mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-28 18:52:16 +01:00
This commit is contained in:
parent
d1ecffdea3
commit
2cc60777d5
@ -71,7 +71,13 @@ export class StratumV1Client extends EasyUnsubscribe {
|
|||||||
data.toString()
|
data.toString()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(m => m.length > 0)
|
.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();
|
'Difficulty too low').response();
|
||||||
console.error(err);
|
console.error(err);
|
||||||
console.log(`Header: ${header.toString('hex')}`);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user