updated
This commit is contained in:
parent
ae475f2b76
commit
a136f922c6
@ -73,7 +73,7 @@ function DaemonInterface(options){
|
|||||||
});
|
});
|
||||||
res.on('end', function(){
|
res.on('end', function(){
|
||||||
var dataJson = JSON.parse(data);
|
var dataJson = JSON.parse(data);
|
||||||
callback(null, dataJson.result);
|
callback(dataJson.error, dataJson.result);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
6
main.js
6
main.js
@ -4,12 +4,6 @@ var bignum = require('bignum');
|
|||||||
|
|
||||||
var pool = require('./pool.js');
|
var pool = require('./pool.js');
|
||||||
|
|
||||||
var fff = "03be78733329d27a63d6ca058a1e3e1048d90e945c2ee985f4bc9042da280a4b";
|
|
||||||
var ff = new Buffer(fff, 'hex');
|
|
||||||
var nn = bignum.fromBuffer(ff);
|
|
||||||
var aa = nn.toBuffer();
|
|
||||||
console.log(aa.toString('hex'));
|
|
||||||
|
|
||||||
|
|
||||||
function Coin(options){
|
function Coin(options){
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|||||||
18
pool.js
18
pool.js
@ -63,11 +63,23 @@ var pool = module.exports = function pool(coin){
|
|||||||
callback(error, result);
|
callback(error, result);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
submitMethod: function(callback){
|
||||||
|
_this.daemon.cmd('submitblock',
|
||||||
|
[],
|
||||||
|
function(error, result){
|
||||||
|
console.log(error);
|
||||||
|
if (error && error.message === 'Method not found')
|
||||||
|
callback(null, false);
|
||||||
|
else
|
||||||
|
callback(null, true);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}, function(err, results){
|
}, function(err, results){
|
||||||
if (err) return;
|
if (err) return;
|
||||||
|
|
||||||
|
coin.options.hasSubmitMethod = results.submitMethod;
|
||||||
|
|
||||||
publicKeyBuffer = coin.options.reward === 'POW' ?
|
publicKeyBuffer = coin.options.reward === 'POW' ?
|
||||||
util.script_to_address(results.addressInfo.address) :
|
util.script_to_address(results.addressInfo.address) :
|
||||||
@ -75,8 +87,8 @@ var pool = module.exports = function pool(coin){
|
|||||||
|
|
||||||
_this.jobManager.newTemplate(results.rpcTemplate, publicKeyBuffer);
|
_this.jobManager.newTemplate(results.rpcTemplate, publicKeyBuffer);
|
||||||
|
|
||||||
console.log(results.rpcTemplate);
|
//console.log(results.rpcTemplate);
|
||||||
console.log(_this.jobManager.currentJob.getJobParams());
|
//console.log(_this.jobManager.currentJob.getJobParams());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user