Merge pull request #17 from matiu/bug/callback-on-rpc-error
Bug/callback on rpc error
This commit is contained in:
commit
dae419e81f
|
@ -20,8 +20,6 @@ function spec(b) {
|
|||
var doubleSha256 = b.doubleSha256 || util.twoSha256;
|
||||
var nonce = util.generateNonce();
|
||||
|
||||
var Block = require('./Block').class();
|
||||
|
||||
var BIP0031_VERSION = 60000;
|
||||
|
||||
function Connection(socket, peer) {
|
||||
|
|
|
@ -180,7 +180,9 @@ function ClassSpec(b) {
|
|||
});
|
||||
});
|
||||
req.on('error', function(e) {
|
||||
log.err('Could not connect to bitcoin via RPC: '+e);
|
||||
var err = new Error('Could not connect to bitcoin via RPC: '+e.message);
|
||||
log.err(err);
|
||||
callback(err);
|
||||
});
|
||||
|
||||
req.setHeader('Content-Length', request.length);
|
||||
|
|
Loading…
Reference in New Issue