coin-hive-stratum
Advanced tools
Comparing version 2.1.0 to 2.1.1
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -173,3 +165,3 @@ var WebSocket = require("ws"); | ||
var _this = this; | ||
return __assign({}, Object.keys(this.connections).reduce(function (stats, key) { return ({ | ||
return Object.keys(this.connections).reduce(function (stats, key) { return ({ | ||
miners: stats.miners + _this.connections[key].reduce(function (miners, connection) { return miners + connection.miners.length; }, 0), | ||
@@ -180,11 +172,3 @@ connections: stats.connections + _this.connections[key].filter(function (connection) { return !connection.donation; }).length | ||
connections: 0 | ||
}), { raw: Object.keys(this.connections).reduce(function (raw, key) { | ||
return (__assign({}, raw, (_a = {}, _a[key] = _this.connections[key].map(function (connection) { return ({ | ||
id: connection.id, | ||
miners: connection.miners.map(function (miner) { return miner.id; }), | ||
donations: connection.donations.map(function (donation) { return donation.id; }), | ||
donation: connection.donation | ||
}); }), _a))); | ||
var _a; | ||
}, {}) }); | ||
}); | ||
}; | ||
@@ -211,3 +195,4 @@ Proxy.prototype.kill = function () { | ||
var availableConnection = connections.filter(function (connection) { return _this.isAvailable(connection); }); | ||
availableConnection.forEach(function (unusedConnection) { | ||
var unusedConnections = availableConnection.slice(1); | ||
unusedConnections.forEach(function (unusedConnection) { | ||
console.log("purge", unusedConnection.id); | ||
@@ -214,0 +199,0 @@ _this.connections[connectionId] = _this.connections[connectionId].filter(function (connection) { return connection.id !== unusedConnection.id; }); |
{ | ||
"name": "coin-hive-stratum", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "proxy to use CoinHive miner on any stratum pool", | ||
@@ -5,0 +5,0 @@ "main": "build", |
@@ -211,7 +211,7 @@ import * as WebSocket from "ws"; | ||
purge() { | ||
console.log("purging..."); | ||
Object.keys(this.connections).forEach(connectionId => { | ||
const connections = this.connections[connectionId]; | ||
const availableConnection = connections.filter(connection => this.isAvailable(connection)); | ||
availableConnection.forEach(unusedConnection => { | ||
const unusedConnections = availableConnection.slice(1); | ||
unusedConnections.forEach(unusedConnection => { | ||
console.log("purge", unusedConnection.id); | ||
@@ -218,0 +218,0 @@ this.connections[connectionId] = this.connections[connectionId].filter( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72914
1900