From 36281230a09048c90b69dab89bbb9fb9422ff963 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 1 May 2014 06:22:53 -0300 Subject: [PATCH 1/2] update test. --- test/integration/blockExtractor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/blockExtractor.js b/test/integration/blockExtractor.js index 0e222f833..a83766c51 100644 --- a/test/integration/blockExtractor.js +++ b/test/integration/blockExtractor.js @@ -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'); From 9b4ba424a8634c0f6a3328131ccc4b7deb68f519 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 13 May 2014 17:00:32 -0300 Subject: [PATCH 2/2] fix bug handling unconfirmed txs --- lib/TransactionDb.js | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/TransactionDb.js b/lib/TransactionDb.js index 67ada5e71..dfa7ef2a3 100644 --- a/lib/TransactionDb.js +++ b/lib/TransactionDb.js @@ -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) @@ -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 { diff --git a/package.json b/package.json index f7b2404a0..753780983 100644 --- a/package.json +++ b/package.json @@ -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": "*",