-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pool identification by output address #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[ | ||
{ | ||
"poolName": "yiimp.eu", | ||
"address": "VbnKqcsnXUYn6iPgZc7qb6fXVKd4i3UWM3", | ||
"url": "http://yiimp.eu" | ||
}, | ||
{ | ||
"poolName": "Suprnova.cc", | ||
"address": "VwDR2x5AZxvKJejtWKiYhrMiZHr5HPVxZv", | ||
"url": "http://vtc.suprnova.cc" | ||
}, | ||
{ | ||
"poolName": "Zergpool", | ||
"address": "VrdN5UoPynUrtYoqWBXsBhN9Hta2pSZaLL", | ||
"url": "http://zergpool.com" | ||
}, | ||
{ | ||
"poolName": "HashRefinery", | ||
"address": "VcV8vPAybuTqzZoR9UksM219gRiTHaE3gi", | ||
"url": "http://pool.hashrefinery.com" | ||
}, | ||
{ | ||
"poolName": "Coinotron", | ||
"address": "VpYQTF5W927YRNxP9osKTTqH3qi8R2r4sB", | ||
"url": "http://coinotron.com" | ||
} | ||
] | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ var util = require('util'); | |
var vertcore = require('vertcore-lib'); | ||
var _ = vertcore.deps._; | ||
var pools = require('../pools.json'); | ||
var addresses = require('../addresses.json'); | ||
var LRU = require('lru-cache'); | ||
var Common = require('./common'); | ||
var vcoin = require('vcoin'); | ||
|
@@ -342,6 +343,15 @@ BlockController.prototype.getPoolInfo = function(tx) { | |
if (!tx) { | ||
return {}; | ||
} | ||
|
||
var outputAddress = tx.outputs[0].address; | ||
|
||
for(var k in addresses) { | ||
if (outputAddress === addresses[k].address) { | ||
return addresses[k]; | ||
} | ||
} | ||
|
||
var coinbaseBuffer = tx.inputs[0].script.raw; | ||
|
||
for(var k in this.poolStrings) { | ||
|
@@ -350,6 +360,10 @@ BlockController.prototype.getPoolInfo = function(tx) { | |
} | ||
} | ||
|
||
if (tx.outputs.length > 1) { | ||
return { "poolName": "P2Pool", "url": "https://vertcoin.org" }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is probably correct but IMO doesn't feel right to assume that multiple outputs must be P2Pool. I'm not sure if there's any other way to detect a P2Pool block though (@metalicjames it would be useful if P2Pool would put something in the coinbase like other pools) It would be nice to be able to configure the pool name & url from pools.json somehow, maybe something like this could work? {
"poolName": "P2Pool",
"url": "https://scanner.vertcoin.org",
"hasManyOutputs": true
} |
||
} | ||
|
||
return {}; | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't the
address
field be added to pools.json, to avoid having 2 separate pool lists to maintain?Also might be worth changing the
address
field to an array of addresses -- didn't Coinotron used to have a different address? (VuPp8H4W3g1dmwGg6pe41D2Khw8JvfEznn?)