Merge pull request #91 from maraoz/bug/address-timestamp
Bug/address timestamp
This commit is contained in:
commit
48ff0bc2b1
|
@ -9,7 +9,6 @@ module.exports.init = function(app, io_ext) {
|
||||||
ios.set('log level', 1); // reduce logging
|
ios.set('log level', 1); // reduce logging
|
||||||
ios.sockets.on('connection', function(socket) {
|
ios.sockets.on('connection', function(socket) {
|
||||||
socket.on('subscribe', function(topic) {
|
socket.on('subscribe', function(topic) {
|
||||||
console.log('subscribe to '+topic);
|
|
||||||
socket.join(topic);
|
socket.join(topic);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,7 +10,7 @@ var async = require('async');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find block by hash ...
|
* Find transaction by hash ...
|
||||||
*/
|
*/
|
||||||
exports.transaction = function(req, res, next, txid) {
|
exports.transaction = function(req, res, next, txid) {
|
||||||
Transaction.fromIdWithInfo(txid, function(err, tx) {
|
Transaction.fromIdWithInfo(txid, function(err, tx) {
|
||||||
|
|
|
@ -110,7 +110,10 @@ TransactionSchema.statics.createFromArray = function(txs, time, next) {
|
||||||
that.create({txid: txid, time: time}, function(err, new_tx) {
|
that.create({txid: txid, time: time}, function(err, new_tx) {
|
||||||
if (err && ! err.toString().match(/E11000/)) return cb(err);
|
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();
|
return cb();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -336,6 +339,7 @@ TransactionSchema.methods.fillInfo = function(next) {
|
||||||
if (err) return next(err);
|
if (err) return next(err);
|
||||||
|
|
||||||
that.info = info;
|
that.info = info;
|
||||||
|
that.info.time = that.time;
|
||||||
return next();
|
return next();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,8 +69,7 @@ function spec() {
|
||||||
}
|
}
|
||||||
this.sync.storeTxs([tx.hash], null, function(err) {
|
this.sync.storeTxs([tx.hash], null, function(err) {
|
||||||
if (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));
|
console.log('[p2p_sync] Error in handle TX: ' + JSON.stringify(err));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,6 +22,7 @@ angular.module('insight.transactions').controller('transactionsController',
|
||||||
txId: txid
|
txId: txid
|
||||||
}, function(tx) {
|
}, function(tx) {
|
||||||
$scope.tx = tx;
|
$scope.tx = tx;
|
||||||
|
console.log(console.log(tx));
|
||||||
$scope.txs.push(tx);
|
$scope.txs.push(tx);
|
||||||
}, function() {
|
}, function() {
|
||||||
$rootScope.flashMessage = 'Transaction Not Found';
|
$rootScope.flashMessage = 'Transaction Not Found';
|
||||||
|
@ -45,7 +46,6 @@ angular.module('insight.transactions').controller('transactionsController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var socket = get_socket($scope);
|
var socket = get_socket($scope);
|
||||||
console.log('transactions.js');
|
|
||||||
socket.on('atx', function(tx) {
|
socket.on('atx', function(tx) {
|
||||||
console.log('Incoming transaction for address!', tx);
|
console.log('Incoming transaction for address!', tx);
|
||||||
$scope.findTx(tx.txid);
|
$scope.findTx(tx.txid);
|
||||||
|
|
Loading…
Reference in New Issue