diff --git a/lib/bitcoin/index.js b/lib/bitcoin/index.js index fdc108a..fc3e662 100644 --- a/lib/bitcoin/index.js +++ b/lib/bitcoin/index.js @@ -1,3 +1,2 @@ module.exports.Client = require('./client'); -module.exports.Pool = require('./pool'); diff --git a/lib/bitcoin/pool.js b/lib/bitcoin/pool.js deleted file mode 100644 index be4cf45..0000000 --- a/lib/bitcoin/pool.js +++ /dev/null @@ -1,41 +0,0 @@ - -var rpc = require('../jsonrpc'); -var util = require('util'); -var events = require('events'); - -function Pool(client) { - if (! this instanceof Pool) - return new Pool(client); - events.EventEmitter.call(this); - this.client = client; - this.server = new rpc.Server(); - var self = this; - - // expose methods - this.server.expose('getwork', function(res) { - self.getWork(res); - }); - -} - -util.inherits(Pool, events.EventEmitter); - - -//===----------------------------------------------------------------------===// -// listen -//===----------------------------------------------------------------------===// -Pool.prototype.listen = function(port, host) { - this.server.listen(port, host); -} - - -//===----------------------------------------------------------------------===// -// getWork (exposed JSON method) -//===----------------------------------------------------------------------===// -Pool.prototype.getWork = function(res) { - this.client.getWork(function(work) { - res(work); - }); -} - -module.exports = Pool; diff --git a/testpool.js b/testpool.js deleted file mode 100644 index 68d793c..0000000 --- a/testpool.js +++ /dev/null @@ -1,6 +0,0 @@ - -var bitcoin = require('./lib/bitcoin'); -var client = new bitcoin.Client('localhost', 8332, 'jb55', 'thisisthepassword'); -var pool = new bitcoin.Pool(client); - -pool.listen(8355, 'localhost');