diff --git a/lib/logger.js b/lib/logger.js index 12b5b27e..0e8576c7 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -31,7 +31,10 @@ Logger.prototype.info = function() { * #error */ Logger.prototype.error = function() { + var existingPermitWrites = this.permitWrites; + this.permitWrites = true; this._log.apply(this, ['red', 'error'].concat(Array.prototype.slice.call(arguments))); + this.permitWrites = existingPermitWrites; }; /** diff --git a/lib/services/db/sync.js b/lib/services/db/sync.js index 4c50c686..02d34198 100644 --- a/lib/services/db/sync.js +++ b/lib/services/db/sync.js @@ -78,13 +78,13 @@ Sync.prototype.initialSync = function() { return; } - self.progressBar = new ProgressBar('[:bar] :percent :current blocks/sec: :blockspersec', { + self.progressBar = new ProgressBar('[:bar] :percent processed: :current blocks/sec: :blockspersec', { complete: green, incomplete: red, total: self.node.services.bitcoind.height }); - console.log('tip: ', self.db.tip.__height); + console.log('starting at tip: ', self.db.tip.__height); self.progressBar.tick(self.db.tip.__height, { blockspersec: 0.0000 }); diff --git a/lib/services/transaction/encoding.js b/lib/services/transaction/encoding.js index bae22587..456abd69 100644 --- a/lib/services/transaction/encoding.js +++ b/lib/services/transaction/encoding.js @@ -36,12 +36,11 @@ Encoding.prototype.encodeTransactionValue = function(transaction) { Encoding.prototype.decodeTransactionValue = function(buffer) { var height = buffer.readUInt32BE(); - var timestamp = buffer.readDoubleBE(4); - var inputValues = []; var inputValuesLength = buffer.readUInt16BE(12); - for(var i = 0; i < inputValuesLength / 8; i++) { + var inputValues = []; + for(var i = 0; i < inputValuesLength; i++) { inputValues.push(buffer.readDoubleBE(i * 8 + 14)); } var transaction = new bitcore.Transaction(buffer.slice(inputValues.length * 8 + 14));