mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-01 11:43:58 +01:00
Minergate bypass
This commit is contained in:
+6
-3
@@ -184,7 +184,7 @@ let VarDiff = (function () {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVersion, portType, port) {
|
function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVersion, portType, port, agent) {
|
||||||
// Username Layout - <address in BTC or XMR>.<Difficulty>
|
// Username Layout - <address in BTC or XMR>.<Difficulty>
|
||||||
// Password Layout - <password>.<miner identifier>.<payment ID for XMR>
|
// Password Layout - <password>.<miner identifier>.<payment ID for XMR>
|
||||||
// Default function is to use the password so they can login. Identifiers can be unique, payment ID is last.
|
// Default function is to use the password so they can login. Identifiers can be unique, payment ID is last.
|
||||||
@@ -195,6 +195,9 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
|
|||||||
let pass_split = pass.split(":");
|
let pass_split = pass.split(":");
|
||||||
this.error = "";
|
this.error = "";
|
||||||
this.identifier = pass_split[0];
|
this.identifier = pass_split[0];
|
||||||
|
if (agent.contains('MinerGate')){
|
||||||
|
this.identifier = "MinerGate";
|
||||||
|
}
|
||||||
this.paymentID = null;
|
this.paymentID = null;
|
||||||
this.valid_miner = true;
|
this.valid_miner = true;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
@@ -568,13 +571,13 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage) {
|
|||||||
}
|
}
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case 'login':
|
case 'login':
|
||||||
if (!params.login || !params.pass) {
|
if (!params.login || (!params.pass && !params.agent.includes('MinerGate'))) {
|
||||||
sendReply("No login/password specified");
|
sendReply("No login/password specified");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let difficulty = portData.difficulty;
|
let difficulty = portData.difficulty;
|
||||||
let minerId = uuidV4();
|
let minerId = uuidV4();
|
||||||
miner = new Miner(minerId, params.login, params.pass, ip, difficulty, pushMessage, 1, portData.portType, portData.port);
|
miner = new Miner(minerId, params.login, params.pass, ip, difficulty, pushMessage, 1, portData.portType, portData.port, params.agent);
|
||||||
if (!miner.valid_miner) {
|
if (!miner.valid_miner) {
|
||||||
console.log("Invalid miner, disconnecting due to: " + miner.error);
|
console.log("Invalid miner, disconnecting due to: " + miner.error);
|
||||||
sendReply(miner.error);
|
sendReply(miner.error);
|
||||||
|
|||||||
Reference in New Issue
Block a user