fixed rounding btc values on homepages

This commit is contained in:
Gustavo Cortez 2014-02-12 11:59:29 -03:00
parent 402bd19336
commit a4a0eef2b0
2 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,7 @@
// server-side socket behaviour // server-side socket behaviour
// io is a variable already taken in express // io is a variable already taken in express
var ios = null; var ios = null;
var util = require('bitcore/util/util');
module.exports.init = function(app, io_ext) { module.exports.init = function(app, io_ext) {
ios = io_ext; ios = io_ext;
@ -25,10 +26,10 @@ module.exports.broadcastTx = function(tx) {
// Outputs // Outputs
var valueOut = 0; var valueOut = 0;
t.vout.forEach( function(o) { t.vout.forEach( function(o) {
valueOut += o.value * 100000000; valueOut += o.value * util.COIN;
}); });
t.valueOut = valueOut / 100000000; t.valueOut = parseInt(valueOut) / util.COIN;
} }
ios.sockets.in('inv').emit('tx', t); ios.sockets.in('inv').emit('tx', t);
} }

View File

@ -24,7 +24,7 @@
</td> </td>
<td><span class="ellipsis">{{humanSince(b.time)}}</span></td> <td><span class="ellipsis">{{humanSince(b.time)}}</span></td>
<td class="text-right">{{b.txlength}}</td> <td class="text-right">{{b.txlength}}</td>
<td class="text-right">{{b.size}}</td> <td class="text-right">{{b.size}} bytes</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>