From 4ae8ddc5bb27832b3e7d188ca7c2737f6299069f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 10 Dec 2014 11:04:24 -0800 Subject: [PATCH] horrible last resort to lookup txes. --- src/bitcoindjs.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 1eb96aba..84ff3884 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -5878,6 +5878,24 @@ get_tx(uint256 txid, uint256& blockhash, CTransaction& ctx) { } } } +#if 0 + // NOTE: Using -txindex would prevent this. + int64_t i = 0; + int64_t height = chainActive.Height(); + for (; i <= height; i++) { + CBlock block; + CBlockIndex* pblockindex = chainActive[i]; + if (ReadBlockFromDisk(block, pblockindex)) { + BOOST_FOREACH(const CTransaction& tx, block.vtx) { + if (tx.GetHash() == txid) { + ctx = tx; + blockhash = block.GetHash(); + return -2; + } + } + } + } +#endif return 0; }