Skip to content

Commit

Permalink
Merge pull request #75 from matiu/bug/fix-unconfigmed-tx
Browse files Browse the repository at this point in the history
Bug/fix unconfigmed tx
  • Loading branch information
maraoz committed May 13, 2014
2 parents 5cf6ce4 + 9b4ba42 commit dfddf83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/TransactionDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ TransactionDb.prototype.add = function(tx, blockhash, cb) {

// existed?
var k = OUTS_PREFIX + tx.txid + '-' + o.n;
db.get(k, function(err) {
if (err && err.notFound) {
db.get(k, function(err, val) {
if (!val || (err && err.notFound)) {
db.batch()
.put(k, addr + ':' + sat)
.put(ADDR_PREFIX + addr + '-' + tx.txid + '-' + o.n, sat + ':' + ts)
Expand Down Expand Up @@ -698,7 +698,6 @@ TransactionDb.prototype.createFromArray = function(txs, blockHash, next) {

Rpc.getTxInfo(t, function(err, inInfo) {
if (!inInfo) return each_cb(err);

return self.add(inInfo, blockHash, each_cb);
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"start": "node node_modules/grunt-cli/bin/grunt"
},
"dependencies": {
"bitcore": "=0.1.18",
"bitcore": "=0.1.19",
"base58-native": "0.1.2",
"async": "*",
"leveldown": "*",
Expand Down
2 changes: 1 addition & 1 deletion test/integration/blockExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('BlockExtractor', function(){
});
});

it('should read next testnet block ', function(done) {
it('should read next '+config.network+' block ', function(done) {
be.getNextBlock(function(err,b) {
assert(!err);
assert(b.timestamp > lastTs, 'timestamp > genesis_ts');
Expand Down

0 comments on commit dfddf83

Please sign in to comment.