Merge pull request #446 from matiu/feat/revert-invalid

Revert "ignore invalid TXs"
This commit is contained in:
Matias Alejo Garcia 2016-01-20 13:05:15 -03:00
commit 05a3311452
2 changed files with 3 additions and 4 deletions

View File

@ -2202,7 +2202,6 @@ WalletService.prototype.getTxHistory = function(opts, cb) {
} else { } else {
action = 'invalid'; action = 'invalid';
amount = 0; amount = 0;
log.warn("Got Invalid TX from address:", JSON.stringify(tx));
} }
function outputMap(o) { function outputMap(o) {
@ -2283,7 +2282,6 @@ WalletService.prototype.getTxHistory = function(opts, cb) {
var txs = res[1]; var txs = res[1];
txs = decorate(txs, addresses, proposals); txs = decorate(txs, addresses, proposals);
txs = _.filter(txs, function(tx) { return tx.action != 'invalid' })
return cb(null, txs); return cb(null, txs);
}); });

View File

@ -4816,7 +4816,7 @@ describe('Wallet service', function() {
done(); done();
}); });
}); });
it('should handle filter out invalid txs in history ', function(done) { it('should handle invalid tx in history ', function(done) {
var h = _.clone(TestData.history); var h = _.clone(TestData.history);
h.push({ h.push({
txid: 'xx' txid: 'xx'
@ -4827,7 +4827,8 @@ describe('Wallet service', function() {
server.getTxHistory({}, function(err, txs) { server.getTxHistory({}, function(err, txs) {
should.not.exist(err); should.not.exist(err);
should.exist(txs); should.exist(txs);
txs.length.should.equal(l); txs.length.should.equal(l + 1);
txs[l].action.should.equal('invalid');
done(); done();
}); });
}); });