New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitcoin

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

4

Changelog.md
# node-bitcoin changelog
## v1.2.2 (2012/04/26)
Fix callback being called twice when a client and request error
occur on the same command call.
## v1.2.1 (2012/04/26)

@@ -4,0 +8,0 @@ * Add missing `getBlock` command

18

lib/jsonrpc.js

@@ -18,2 +18,3 @@ var util = require('util');

var client = http.createClient(port, host);
var clientRequestErrorCalled = false;

@@ -44,11 +45,12 @@ // First we encode the request into JSON

request.write(requestJSON);
function clientRequestErrorHandler(e) {
if (!clientRequestErrorCalled) {
clientRequestErrorCalled = true;
errback(e);
}
}
client.on('error', clientRequestErrorHandler);
request.on('error', clientRequestErrorHandler);
client.on('error', function(e){
errback(e);
});
request.on('error', function(e){
errback(e);
});
request.on('response', function(response) {

@@ -55,0 +57,0 @@ // We need to buffer the response chunks in a nonblocking way.

{
"name": "bitcoin",
"description": "Communicate with bitcoind via JSON-RPC",
"version": "1.2.1",
"version": "1.2.2",
"main": "./lib/bitcoin",

@@ -6,0 +6,0 @@ "keywords": [

@@ -177,3 +177,19 @@ var path = require('path');

},
'creating a client on a non-listening port': {
topic: function() {
return new bitcoin.Client(config.host, 9897, 'baduser', 'badpwd');
},
'will return client object': function(client) {
assert.equal(typeof client, 'object');
},
'but when calling a command': {
topic: function(client) {
client.listSinceBlock(this.callback);
},
'should not call callback more than once': function(err, result) {
assert.instanceOf(err, Error);
}
}
}
}).export(module);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc