mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-18 05:31:26 +02:00
Adding limit ranges and port blocking on the API.
This commit is contained in:
+7
-1
@@ -22,6 +22,7 @@ let httpResponse = ' 200 OK\nContent-Type: text/plain\nContent-Length: 18\n\nMin
|
||||
let threadName;
|
||||
let minerCount = [];
|
||||
let BlockTemplate = global.coinFuncs.BlockTemplate;
|
||||
let hexMatch = new RegExp("^[0-9a-f]$");
|
||||
|
||||
Buffer.prototype.toByteArray = function () {
|
||||
return Array.prototype.slice.call(this, 0);
|
||||
@@ -232,9 +233,14 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
|
||||
this.error = "Too many options in the login field";
|
||||
this.valid_miner = false;
|
||||
}
|
||||
if (typeof(addressSplit[1]) !== 'undefined' && (addressSplit[1].length === 16 || addressSplit[1].length === 64)) {
|
||||
if (typeof(addressSplit[1]) !== 'undefined' && addressSplit[1].length === 64 && addressSplit[1].test(hexMatch)) {
|
||||
this.paymentID = addressSplit[1];
|
||||
this.payout = this.address + "." + this.paymentID;
|
||||
} else if (addressSplit[1] !== 'undefined') {
|
||||
this.identifier = this.identifier === 'x' ? addressSplit[1] : pass_split[0];
|
||||
}
|
||||
if (typeof(addressSplit[2]) !== 'undefined') {
|
||||
this.identifier = this.identifier === 'x' ? addressSplit[2] : pass_split[0];
|
||||
}
|
||||
|
||||
if (pass_split.length === 2) {
|
||||
|
||||
Reference in New Issue
Block a user