bitcoind: variable name fixes

This commit is contained in:
Braydon Fuller 2016-03-31 10:15:29 -04:00
parent af573b765b
commit 7d7dfe329d

View File

@ -130,7 +130,7 @@ Bitcoin.prototype._loadConfiguration = function() {
); );
$.checkState( $.checkState(
this.configuration.zmqpubhashtx, this.configuration.zmqpubhashblock,
'"zmqpubhashblock" option is required to get event updates from bitcoind. ' + '"zmqpubhashblock" option is required to get event updates from bitcoind. ' +
'Please add "zmqpubhashblock=tcp://127.0.0.1:<port>" to your configuration and restart' 'Please add "zmqpubhashblock=tcp://127.0.0.1:<port>" to your configuration and restart'
); );
@ -632,7 +632,7 @@ Bitcoin.prototype.getAddressSummary = function(addressArg, options, callback) {
* Will retrieve a block as a Node.js Buffer from disk. * Will retrieve a block as a Node.js Buffer from disk.
* @param {String|Number} block - A block hash or block height number * @param {String|Number} block - A block hash or block height number
*/ */
Bitcoin.prototype.getBlock = function(block, callback) { Bitcoin.prototype.getBlock = function(blockArg, callback) {
// TODO apply performance patch to the RPC method for raw data // TODO apply performance patch to the RPC method for raw data
var self = this; var self = this;
@ -641,20 +641,20 @@ Bitcoin.prototype.getBlock = function(block, callback) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
var blockCache = bitcore.Block.fromString(response.result); var blockObj = bitcore.Block.fromString(response.result);
self.blockCache.set(block, blockCache); self.blockCache.set(blockArg, blockObj);
callback(null, blockCache); callback(null, blockObj);
}); });
} }
var cachedBlock = self.blockCache.get(block); var cachedBlock = self.blockCache.get(blockArg);
if (cachedBlock) { if (cachedBlock) {
return setImmediate(function() { return setImmediate(function() {
callback(null, cachedBlock); callback(null, cachedBlock);
}); });
} else { } else {
if (_.isNumber(block)) { if (_.isNumber(blockArg)) {
self.client.getBlockHash(block, function(err, response) { self.client.getBlockHash(blockArg, function(err, response) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
@ -662,7 +662,7 @@ Bitcoin.prototype.getBlock = function(block, callback) {
queryBlock(blockhash); queryBlock(blockhash);
}); });
} else { } else {
queryBlock(block); queryBlock(blockArg);
} }
} }