Removed pool from master
This commit is contained in:
parent
d3fa7ceba2
commit
b87fb0278a
@ -1,3 +1,2 @@
|
||||
|
||||
module.exports.Client = require('./client');
|
||||
module.exports.Pool = require('./pool');
|
||||
|
||||
@ -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;
|
||||
@ -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');
|
||||
Loading…
Reference in New Issue
Block a user