diff --git a/example/index.js b/example/index.js index 451c21ed..227399d9 100755 --- a/example/index.js +++ b/example/index.js @@ -75,7 +75,7 @@ function getBlocks(bitcoind) { var txid = block.tx[0].txid; // XXX Dies with a segfault // bitcoind.getTx(txid, hash, function(err, tx) { - bitcoind.getTx(txid, hash, function(err, tx) { + bitcoind.getTx(txid, function(err, tx) { if (err) return print(err.message); print('TX -----------------------------------------------------'); print(tx); diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index d75da82d..af0ebc02 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -692,17 +692,10 @@ async_get_tx(uv_work_t *req) { uint256 hashBlock(data->blockHash); CTransaction tx; - if (GetTransaction(hash, tx, hashBlock, hashBlock == uint256(0) ? true : false)) { + if (GetTransaction(hash, tx, hashBlock, true)) { data->result_tx = tx; } else { - if (hashBlock != 0) { - hashBlock = uint256(0); - if (GetTransaction(hash, tx, hashBlock, true)) { - data->result_tx = tx; - } else { - data->err_msg = std::string("get_tx(): failed."); - } - } + data->err_msg = std::string("get_tx(): failed."); } }