This commit is contained in:
Ben Wilson
2023-08-05 10:54:37 -04:00
parent 7dbe64300a
commit 10e005c0e9

View File

@@ -82,9 +82,13 @@ export class StratumV1Client {
} }
public destroy() { public destroy() {
if (this.stratumSubscription != null) {
this.stratumSubscription.unsubscribe(); this.stratumSubscription.unsubscribe();
}
if (this.backgroundWork != null) {
clearInterval(this.backgroundWork); clearInterval(this.backgroundWork);
} }
}
private getRandomHexString() { private getRandomHexString() {
const randomBytes = crypto.randomBytes(4); // 4 bytes = 32 bits const randomBytes = crypto.randomBytes(4); // 4 bytes = 32 bits