|
|
@ -169,27 +169,31 @@ function getMinerFromCoinbaseTx(tx) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
if (global.miningPoolsConfig) { |
|
|
|
for (var payoutAddress in global.miningPoolsConfig.payout_addresses) { |
|
|
|
if (global.miningPoolsConfig.payout_addresses.hasOwnProperty(payoutAddress)) { |
|
|
|
if (tx.vout && tx.vout.length > 0 && tx.vout[0].scriptPubKey && tx.vout[0].scriptPubKey.addresses && tx.vout[0].scriptPubKey.addresses.length > 0) { |
|
|
|
if (tx.vout[0].scriptPubKey.addresses[0] == payoutAddress) { |
|
|
|
var minerInfo = global.miningPoolsConfig.payout_addresses[payoutAddress]; |
|
|
|
minerInfo.identifiedBy = "payout address " + payoutAddress; |
|
|
|
|
|
|
|
return minerInfo; |
|
|
|
if (global.miningPoolsConfigs) { |
|
|
|
for (var i = 0; i < global.miningPoolsConfigs.length; i++) { |
|
|
|
var miningPoolsConfig = global.miningPoolsConfigs[i]; |
|
|
|
|
|
|
|
for (var payoutAddress in miningPoolsConfig.payout_addresses) { |
|
|
|
if (miningPoolsConfig.payout_addresses.hasOwnProperty(payoutAddress)) { |
|
|
|
if (tx.vout && tx.vout.length > 0 && tx.vout[0].scriptPubKey && tx.vout[0].scriptPubKey.addresses && tx.vout[0].scriptPubKey.addresses.length > 0) { |
|
|
|
if (tx.vout[0].scriptPubKey.addresses[0] == payoutAddress) { |
|
|
|
var minerInfo = miningPoolsConfig.payout_addresses[payoutAddress]; |
|
|
|
minerInfo.identifiedBy = "payout address " + payoutAddress; |
|
|
|
|
|
|
|
return minerInfo; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for (var coinbaseTag in global.miningPoolsConfig.coinbase_tags) { |
|
|
|
if (global.miningPoolsConfig.coinbase_tags.hasOwnProperty(coinbaseTag)) { |
|
|
|
if (hex2ascii(tx.vin[0].coinbase).indexOf(coinbaseTag) != -1) { |
|
|
|
var minerInfo = global.miningPoolsConfig.coinbase_tags[coinbaseTag]; |
|
|
|
minerInfo.identifiedBy = "coinbase tag '" + coinbaseTag + "'"; |
|
|
|
for (var coinbaseTag in miningPoolsConfig.coinbase_tags) { |
|
|
|
if (miningPoolsConfig.coinbase_tags.hasOwnProperty(coinbaseTag)) { |
|
|
|
if (hex2ascii(tx.vin[0].coinbase).indexOf(coinbaseTag) != -1) { |
|
|
|
var minerInfo = miningPoolsConfig.coinbase_tags[coinbaseTag]; |
|
|
|
minerInfo.identifiedBy = "coinbase tag '" + coinbaseTag + "'"; |
|
|
|
|
|
|
|
return minerInfo; |
|
|
|
return minerInfo; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|