Merge pull request #75 from matiu/bug/fix-unconfigmed-tx

Bug/fix unconfigmed tx
This commit is contained in:
Manuel Aráoz 2014-05-13 17:02:12 -03:00
commit dfddf836d8
3 changed files with 4 additions and 5 deletions

View File

@ -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 {

View File

@ -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": "*",

View File

@ -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');