This commit is contained in:
Chris Kleeschulte 2017-02-06 08:01:16 -05:00
parent f83b8a63e3
commit ee62cbf178
3 changed files with 7 additions and 5 deletions

View File

@ -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;
};
/**

View File

@ -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
});

View File

@ -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));