fix conflics

This commit is contained in:
Matias Alejo Garcia 2014-01-23 13:00:27 -03:00
parent 9cd370b7e9
commit 37783c5286
6 changed files with 26 additions and 46 deletions

View File

@ -9,11 +9,11 @@ module.exports = {
protocol: process.env.BITCOIND_PROTO || 'http',
user: process.env.BITCOIND_USER || 'user',
pass: process.env.BITCOIND_PASS || 'pass',
host: process.env.BITCOIND_HOST || '127.0.0.1',
port: process.env.BITCOIND_PORT || '18332',
host: process.env.BITCOIND_HOST || '162.242.219.26',
port: process.env.BITCOIND_PORT || '8332',
disableAgent: true,
},
network: process.env.INSIGHT_NETWORK || 'testnet',
network: process.env.INSIGHT_NETWORK || 'livenet',
disableP2pSync: false,
disableHistoricSync: false,
};

View File

@ -68,6 +68,7 @@ function spec() {
err = new Error(BAD_GEN_ERROR + config.network);
self.setError(err);
}
if (err) self.setError(err);
return cb(err);
});
}
@ -87,6 +88,7 @@ function spec() {
syncPercentage: this.syncPercentage,
skippedBlocks: this.skippedBlocks,
syncedBlocks: this.syncedBlocks,
error: this.error,
};
};
@ -94,7 +96,7 @@ function spec() {
var self = this;
if (self.error) {
p('ERROR:' + self.error);
p('ERROR: ' + self.error);
}
else {
self.syncPercentage = parseFloat(100 * self.syncedBlocks / self.blockChainHeight).toFixed(3);

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('insight.status').controller('StatusController',
function($scope, $routeParams, $location, $rootScope, Global, Status, Sync, getSocket) {
function($scope, $routeParams, $location, Global, Status, Sync, getSocket) {
$scope.global = Global;
$scope.getStatus = function(q) {
@ -9,16 +9,11 @@ function($scope, $routeParams, $location, $rootScope, Global, Status, Sync, getS
q: 'get' + q
},
function(d) {
$rootScope.infoError = null;
$scope.loaded = 1;
angular.extend($scope, d);
},
function(e) {
if (e.status === 503) {
$rootScope.infoError = 'Backend Error. ' + e.data;
}
else {
$rootScope.infoError = 'Unknown error:' + e.data;
}
$scope.error = 'API ERROR: ' + e.data;
});
};
@ -32,16 +27,15 @@ function($scope, $routeParams, $location, $rootScope, Global, Status, Sync, getS
_onSyncUpdate(sync);
},
function(e) {
$scope.sync = { error: 'Could not get sync information' + e };
var err = 'Could not get sync information' + e.toString();
$scope.sync = { error: err };
});
};
var socket = getSocket($scope);
socket.emit('subscribe', 'sync');
socket.on('status', function(sync) {
console.log('[status.js.55::] sync status update received!');
_onSyncUpdate(sync);
});
});

View File

@ -0,0 +1,4 @@
<span colspan="2" class="text-center" data-ng-show="!loaded && !error">Loading...</span>
<span class="text-danger" data-ng-show="error">{{error}}</span>

View File

@ -10,9 +10,9 @@
<h4>Sync Status</h4>
<table class="table" data-ng-init="getSync()">
<tbody>
<tr data-ng-show="sync.error">
<td colspan="2"> <span class="text-danger"> {{sync.error}} </span>
</tr>
<thead>
<span class="text-danger" data-ng-show="sync && sync.error">{{sync.error}}</span>
</thead>
<tr>
<td>Sync Progress</td>
<td>
@ -37,13 +37,9 @@
<h4>Transaction Output Set Information</h4>
<table class="table" data-ng-init="getStatus('TxOutSetInfo')">
<tbody>
<tr data-ng-show="!txoutsetinfo &amp;&amp; !infoError">
<td colspan="2" class="text-center">Loading...</td>
</tr>
<tr data-ng-show="infoError">
<td colspan="2" class="text-danger">{{infoError}}</td>
</tr>
<thead data-ng-include src="'/views/infoStatus.html'">
</thead>
<tbody >
<tr>
<td>Height</td>
<td class="text-right"><a href="/#!/block-index/{{txoutsetinfo.height}}">{{txoutsetinfo.height}}</a></td>
@ -77,13 +73,7 @@
<h4>Last Block</h4>
<table class="table" data-ng-init="getStatus('LastBlockHash')">
<tbody>
<tr data-ng-show="!lastblockhash &amp;&amp; !infoError">
<td colspan="2" class="text-center">Loading...</td>
</tr>
<tr data-ng-show="infoError">
<td colspan="2" class="text-danger">{{infoError}}</td>
</tr>
<tbody data-ng-include src="'/views/infoStatus.html'">
<tr>
<td>Last block hash</td>
<td class="text-right"><a href="/#!/block/{{lastblockhash}}">{{lastblockhash}}</a></td>
@ -96,11 +86,7 @@
<div class="col-gray">
<h4>Bitcoin node information</h4>
<table class="table" data-ng-init="getStatus('Info')">
<tbody>
<tr data-ng-show="!info &amp;&amp; !infoError">
<td colspan="2" class="text-center">Loading...
<tr data-ng-show="infoError">
<td colspan="2" class="text-danger">{{infoError}}
<tbody data-ng-include src="'/views/infoStatus.html'">
<tr>
<td>Version</td>
<td class="text-right">{{info.version}}</td>
@ -162,14 +148,7 @@
<h4>Difficulty</h4>
<table class="table" data-ng-init="getStatus('Difficulty')">
<tbody>
<tr data-ng-show="!difficulty &amp;&amp; !infoError">
<td colspan="2" class="text-center">Loading...</td>
</tr>
<tr data-ng-show="infoError">
<td colspan="2" class="text-danger">{{infoError}}</td>
</tr>
<tbody data-ng-include src="'/views/infoStatus.html'">
<tr>
<td>Mining Difficulty</td>
<td>{{difficulty}}</td>

View File

@ -32,6 +32,7 @@ async.series([
historicSync.init(program, cb);
},
function(cb) {
if (program.smart) {
historicSync.smartImport(cb);
}
@ -47,7 +48,7 @@ async.series([
function(err) {
historicSync.close();
if (err) {
console.log('CRITICAL ERROR: ', err);
console.log('CRITICAL ERROR: ', historicSync.info());
}
else {
console.log('Finished.\n Status:\n', historicSync.info());