Merge pull request #91 from maraoz/bug/address-timestamp

Bug/address timestamp
This commit is contained in:
Manuel Aráoz 2014-01-20 10:48:23 -08:00
commit 48ff0bc2b1
5 changed files with 8 additions and 6 deletions

View File

@ -9,7 +9,6 @@ module.exports.init = function(app, io_ext) {
ios.set('log level', 1); // reduce logging
ios.sockets.on('connection', function(socket) {
socket.on('subscribe', function(topic) {
console.log('subscribe to '+topic);
socket.join(topic);
});
});

View File

@ -10,7 +10,7 @@ var async = require('async');
/**
* Find block by hash ...
* Find transaction by hash ...
*/
exports.transaction = function(req, res, next, txid) {
Transaction.fromIdWithInfo(txid, function(err, tx) {

View File

@ -110,7 +110,10 @@ TransactionSchema.statics.createFromArray = function(txs, time, next) {
that.create({txid: txid, time: time}, function(err, new_tx) {
if (err && ! err.toString().match(/E11000/)) return cb(err);
if (new_tx) mongo_txs.push(new_tx);
if (new_tx) {
mongo_txs.push(new_tx);
}
return cb();
});
});
@ -336,6 +339,7 @@ TransactionSchema.methods.fillInfo = function(next) {
if (err) return next(err);
that.info = info;
that.info.time = that.time;
return next();
});
};

View File

@ -69,8 +69,7 @@ function spec() {
}
this.sync.storeTxs([tx.hash], null, function(err) {
if (err) {
console.log('[PeerSync.js.71:err:]',err); //TODO
console.log('[PeerSync.js.71:err:]',err); //TODO
console.log('[p2p_sync] Error in handle TX: ' + JSON.stringify(err));
}
});

View File

@ -22,6 +22,7 @@ angular.module('insight.transactions').controller('transactionsController',
txId: txid
}, function(tx) {
$scope.tx = tx;
console.log(console.log(tx));
$scope.txs.push(tx);
}, function() {
$rootScope.flashMessage = 'Transaction Not Found';
@ -45,7 +46,6 @@ angular.module('insight.transactions').controller('transactionsController',
});
};
var socket = get_socket($scope);
console.log('transactions.js');
socket.on('atx', function(tx) {
console.log('Incoming transaction for address!', tx);
$scope.findTx(tx.txid);