Removed pool from master

This commit is contained in:
Bill Casarin 2010-12-28 09:51:40 -05:00
parent d3fa7ceba2
commit b87fb0278a
3 changed files with 0 additions and 48 deletions

View File

@ -1,3 +1,2 @@
module.exports.Client = require('./client');
module.exports.Pool = require('./pool');

View File

@ -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;

View File

@ -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');