diff --git a/app/controllers/socket.js b/app/controllers/socket.js index d996f4c..f6e9e92 100644 --- a/app/controllers/socket.js +++ b/app/controllers/socket.js @@ -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); }); }); diff --git a/app/controllers/transactions.js b/app/controllers/transactions.js index 833fc66..7276db4 100644 --- a/app/controllers/transactions.js +++ b/app/controllers/transactions.js @@ -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) { diff --git a/app/models/Transaction.js b/app/models/Transaction.js index 2ecfd59..b4f67f2 100644 --- a/app/models/Transaction.js +++ b/app/models/Transaction.js @@ -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(); }); }; diff --git a/lib/PeerSync.js b/lib/PeerSync.js index 3d7e89c..7ef05cd 100644 --- a/lib/PeerSync.js +++ b/lib/PeerSync.js @@ -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)); } }); diff --git a/public/js/controllers/transactions.js b/public/js/controllers/transactions.js index ccb3a92..0658c5c 100644 --- a/public/js/controllers/transactions.js +++ b/public/js/controllers/transactions.js @@ -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);