diff --git a/controllers/units.js b/controllers/units.js index 885b749..0f326b9 100644 --- a/controllers/units.js +++ b/controllers/units.js @@ -255,6 +255,7 @@ function getUnitSequence(unit, cb) { }); } + function getInfoOnUnit(unit, cb) { storage.readUnitProps(db, unit, function(unitProps) { storage.readJoint(db, unit, { @@ -282,19 +283,21 @@ function getInfoOnUnit(unit, cb) { messages: objJoint.unit.messages, transfersInfo: transfersInfo, outputsUnit: unitOutputs, + is_on_main_chain:unitProps.is_on_main_chain, date: moment(objJoint.unit.timestamp * 1000).format(), assocCommissions: assocCommissions }; - if (objJoint.unit.witnesses) { - objInfo.witnesses = objJoint.unit.witnesses; - cb(objInfo); - } - else { - storage.readWitnesses(db, unit, function(arrWitnesses) { - objInfo.witnesses = arrWitnesses; - cb(objInfo); - }); - } + // if (objJoint.unit.witnesses) { + // objInfo.witnesses = objJoint.unit.witnesses; + // cb(objInfo); + // } + // else { + // storage.readWitnesses(db, unit, function(arrWitnesses) { + // objInfo.witnesses = arrWitnesses; + // cb(objInfo); + // }); + // } + cb(objInfo); }); }); }); diff --git a/package.json b/package.json index 2930de3..9a637c4 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "async": "^2.1.5", - "trustnote-common": "git+https://github.com/trustnote/trustnote-common.git", + "trustnote-common": "file:../trustnote-common", "express": "^4.14.0", "moment": "^2.17.1", "socket.io": "^1.7.1" diff --git a/public/js/detail.js b/public/js/detail.js index 6a6b037..55726b0 100644 --- a/public/js/detail.js +++ b/public/js/detail.js @@ -853,7 +853,7 @@ function generateMessageInfo(messages, transfersInfo, outputsUnit, assocCommissi socket.on('info', function(data) { if (bWaitingForHighlightNode) bWaitingForHighlightNode = false; if (data) { - var childOut = '', parentOut = '', authorsOut = '', witnessesOut = ''; + var childOut = '', parentOut = '', authorsOut = ''/*, witnessesOut = ''*/; data.child.forEach(function(unit) { childOut += '
' + unit + '
'; }); @@ -870,9 +870,9 @@ socket.on('info', function(data) { } authorsOut += ''; }); - data.witnesses.forEach(function(witness) { - witnessesOut += '
' + witness + '
'; - }); + //data.witnesses.forEach(function(witness) { + // witnessesOut += '
' + witness + '
'; + //}); $('#unit').html(data.unit); $('#children').html(childOut); @@ -886,7 +886,8 @@ socket.on('info', function(data) { $('#main_chain_index').html(data.main_chain_index); $('#latest_included_mc_index').html(data.latest_included_mc_index); $('#is_stable').html(data.is_stable); - $('#witnesses').html(witnessesOut); + $('#is_on_main_chain').html(data.is_on_main_chain); + //$('#witnesses').html(witnessesOut); $('#messages').html(data.sequence === 'final-bad' ? '' : generateMessageInfo(data.messages, data.transfersInfo, data.outputsUnit, data.assocCommissions)); if ($('#listInfo').css('display') === 'none') { $('#defaultInfo').hide(); diff --git a/public/js/main.js b/public/js/main.js index 9a514b1..329f865 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -863,7 +863,7 @@ function generateMessageInfo(messages, transfersInfo, outputsUnit, assocCommissi socket.on('info', function (data) { if (bWaitingForHighlightNode) bWaitingForHighlightNode = false; if (data) { - var childOut = '', parentOut = '', authorsOut = '', witnessesOut = ''; + var childOut = '', parentOut = '', authorsOut = '' /* , witnessesOut = '' */; data.child.forEach(function (unit) { childOut += '
' + unit + '
'; }); @@ -884,9 +884,9 @@ socket.on('info', function (data) { //authorsOut += ''; authorsOut += ''; }); - data.witnesses.forEach(function (witness) { - witnessesOut += '
' + witness + '
'; - }); + //data.witnesses.forEach(function (witness) { + // witnessesOut += '
' + witness + '
'; + //}); $('#unit').html(data.unit); $('#children').html(childOut); @@ -900,7 +900,7 @@ socket.on('info', function (data) { $('#main_chain_index').html(data.main_chain_index); $('#latest_included_mc_index').html(data.latest_included_mc_index); $('#is_stable').html(data.is_stable); - $('#witnesses').html(witnessesOut); + //$('#witnesses').html(witnessesOut); $('#messages').html(data.sequence === 'final-bad' ? '' : generateMessageInfo(data.messages, data.transfersInfo, data.outputsUnit, data.assocCommissions)); if ($('#listInfo').css('display') === 'none') { $('#defaultInfo').hide(); diff --git a/relay.js b/relay.js index 55b0f3f..28fa0da 100644 --- a/relay.js +++ b/relay.js @@ -20,11 +20,11 @@ function start () { network.findOutboundPeerOrConnect(url); }); } - -replaceConsoleLog(); -myWitnesses.readMyWitnesses(function (arrWitnesses) { - if (arrWitnesses.length > 0) - return start(); - console.log('will init witnesses', conf.initial_witnesses); - myWitnesses.insertWitnesses(conf.initial_witnesses, start); -}, 'ignore'); +start(); +// replaceConsoleLog(); +// myWitnesses.readMyWitnesses(function (arrWitnesses) { +// if (arrWitnesses.length > 0) +// return start(); +// console.log('will init witnesses', conf.initial_witnesses); +// myWitnesses.insertWitnesses(conf.initial_witnesses, start); +// }, 'ignore'); diff --git a/views/detail.html b/views/detail.html index 4480cf8..6856ad7 100644 --- a/views/detail.html +++ b/views/detail.html @@ -14,8 +14,8 @@ diff --git a/views/index.html b/views/index.html index b117d46..93fcb70 100644 --- a/views/index.html +++ b/views/index.html @@ -11,8 +11,8 @@