Minergate bypass
This commit is contained in:
parent
4c30b21112
commit
ea8226ccac
1 changed files with 6 additions and 3 deletions
|
|
@ -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>
|
||||
// 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.
|
||||
|
|
@ -195,6 +195,9 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
|
|||
let pass_split = pass.split(":");
|
||||
this.error = "";
|
||||
this.identifier = pass_split[0];
|
||||
if (agent.contains('MinerGate')){
|
||||
this.identifier = "MinerGate";
|
||||
}
|
||||
this.paymentID = null;
|
||||
this.valid_miner = true;
|
||||
this.port = port;
|
||||
|
|
@ -568,13 +571,13 @@ function handleMinerData(method, params, ip, portData, sendReply, pushMessage) {
|
|||
}
|
||||
switch (method) {
|
||||
case 'login':
|
||||
if (!params.login || !params.pass) {
|
||||
if (!params.login || (!params.pass && !params.agent.includes('MinerGate'))) {
|
||||
sendReply("No login/password specified");
|
||||
return;
|
||||
}
|
||||
let difficulty = portData.difficulty;
|
||||
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) {
|
||||
console.log("Invalid miner, disconnecting due to: " + miner.error);
|
||||
sendReply(miner.error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue