From 7c344b5f24520af8738b21c82d9f6f2b50a77c56 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Thu, 7 Apr 2016 16:22:54 -0400 Subject: [PATCH] build: updates for npm install --- integration/p2p.js | 3 ++- lib/transaction.js | 6 ++++-- package.json | 3 ++- scripts/install | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/integration/p2p.js b/integration/p2p.js index 3e30e464..47c45a86 100644 --- a/integration/p2p.js +++ b/integration/p2p.js @@ -1,5 +1,6 @@ 'use strict'; +var path = require('path'); var index = require('..'); var log = index.log; @@ -64,7 +65,7 @@ describe('P2P Functionality', function() { bitcoind = require('../').services.Bitcoin({ spawn: { datadir: datadir, - exec: 'bitcoind' + exec: path.resolve(__dirname, '../bin/bitcoind') }, node: { network: bitcore.Networks.testnet diff --git a/lib/transaction.js b/lib/transaction.js index f55df37b..1f826c45 100644 --- a/lib/transaction.js +++ b/lib/transaction.js @@ -1,10 +1,12 @@ 'use strict'; var async = require('async'); -var levelup = require('levelup'); var bitcore = require('bitcore-lib'); var Transaction = bitcore.Transaction; +var index = require('./'); +var errors = index.errors; + var MAX_TRANSACTION_LIMIT = 5; Transaction.prototype.populateInputs = function(db, poolTransactions, callback) { @@ -30,7 +32,7 @@ Transaction.prototype._populateInput = function(db, input, poolTransactions, cal } var txid = input.prevTxId.toString('hex'); db.getTransaction(txid, true, function(err, prevTx) { - if(err instanceof levelup.errors.NotFoundError) { + if(err instanceof errors.Transaction.NotFoundError) { // Check the pool for transaction for(var i = 0; i < poolTransactions.length; i++) { if(txid === poolTransactions[i].hash) { diff --git a/package.json b/package.json index 8ec46e56..0cdfbf4b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ ], "dependencies": { "async": "^1.3.0", - "bitcoind-rpc": "^0.3.0", + "bitcoind-rpc": "braydonf/bitcoind-rpc#8d27a545f4e7de5a8faca5de6bdbb1a6c1e41f5c", "bitcore-lib": "^0.13.13", "body-parser": "^1.13.3", "colors": "^1.1.2", @@ -58,6 +58,7 @@ }, "devDependencies": { "benchmark": "1.0.0", + "bitcore-p2p": "^1.1.0", "chai": "^3.0.0", "mocha": "~1.16.2", "proxyquire": "^1.3.1", diff --git a/scripts/install b/scripts/install index 132775f3..3ded019c 100755 --- a/scripts/install +++ b/scripts/install @@ -44,7 +44,7 @@ if test $? -eq 0; then echo "Unpacking bitcoin distribution" tar -xvzf $tarball_name if test $? -eq 0; then - ln -s "bitcoin-${version}/bin/bitcoind" + ln -sf "bitcoin-${version}/bin/bitcoind" exit 0 fi fi