diff --git a/addresses.json b/addresses.json new file mode 100644 index 000000000..2d33ca10a --- /dev/null +++ b/addresses.json @@ -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" + } +] \ No newline at end of file diff --git a/lib/blocks.js b/lib/blocks.js index 8963f1773..f38caa1ca 100644 --- a/lib/blocks.js +++ b/lib/blocks.js @@ -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" }; + } + return {}; };